home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / dosref23.zip / CHAPTER.003 < prev    next >
Text File  |  1992-03-16  |  121KB  |  2,556 lines

  1.  
  2.        **  Programmer's Technical Reference for MSDOS and the IBM PC **
  3.                 USA copyright TXG 392-616  ALL RIGHTS RESERVED
  4. ───────────────────────────────┤ DOSREF (tm) ├────────────────────────────────
  5.                      ISBN 1-878830-02-3 (disk-based text)
  6.                     Copyright (c) 1987, 1992 Dave Williams
  7.                         ┌─────────────────────────────┐
  8.                         │ Shareware Version, 03/16/92 │
  9.                         │  Please Register Your Copy  │
  10.                         └─────────────────────────────┘
  11.  
  12.  
  13.                           C H A P T E R    T H R E E
  14.  
  15.  
  16.                                 THE PC ROM BIOS
  17.  
  18.  
  19.                                 C O N T E N T S
  20.  
  21. Calling the ROM BIOS .................................................. 3**1
  22. Interrupt 10h  Video Services ......................................... 3**2
  23. Interrupt 11h  Equipment Check ........................................ 3**3
  24. Interrupt 12h  Memory Size ............................................ 3**4
  25. Interrupt 13h  Disk Functions ......................................... 3**5
  26. Interrupt 14h  Initialize and Access Serial Port ...................... 3**6
  27.                FOSSIL Drivers ......................................... 3**7
  28. Interrupt 15h  Cassette I/O ........................................... 3**8
  29. Interrupt 16h  Keyboard I/O ........................................... 3**9
  30. Interrupt 17h  Printer ................................................ 3**10
  31. Interrupt 18h  ROM BASIC .............................................. 3**11
  32. Interrupt 19h  Bootstrap Loader ....................................... 3**12
  33. Interrupt 1Ah  Time of Day ............................................ 3**13
  34. Interrupt 1Bh  Control-Break .......................................... 3**14
  35. Interrupt 1Ch  Timer Tick ............................................. 3**15
  36. Interrupt 1Dh  Vector of Video Initialization Parameters .............. 3**16
  37. Interrupt 1Eh  Vector of Diskette Controller Parameters ............... 3**17
  38. Interrupt 1Fh  Ptr to Graphics Character Extensions (Graphics Set 2) .. 3**18
  39.  
  40.  
  41.  
  42.  The ROM BIOS is the lowest level of software access. It contains the
  43. following routines:
  44.  
  45.    (all)
  46.         power-on self-test (POST)
  47.         boostrap loader
  48.         clock
  49.         floppy disk I/O
  50.         video I/O
  51.         keyboard
  52.         serial ports
  53.         parallel ports
  54.         print screen
  55.         equipment check
  56.         report memory size
  57.  
  58.  
  59.     (AT)
  60.         hard disk I/O
  61.         report memory size (extended memory)
  62.         extended memory block moves
  63.         enhanced video and keyboard I/O
  64.         high resolution timer
  65.         alarm
  66.  
  67.   Machines such as the PC Convertible, PCjr, and non-IBM machines add
  68. additional functions.
  69.  
  70.  
  71. Calling the ROM BIOS .................................................. 3**1
  72.  
  73.  The BIOS services are invoked by placing the number of the desired function in
  74. register AH, subfunction in AL, setting the other registers to any specific
  75. requirements of the function, and invoking any of ints 10h through int 1Fh.
  76.  
  77.  The original IBM PC Technical Reference gave the absolute addresses of the
  78. ROM routines. Some early software jumped directly to these addresses, with
  79. mixed results on non-IBM BIOSes. This practice was common on machines
  80. predating the PC, but there is no practical use for it now. The OS/2
  81. Compatibility Box also does not support jumping directly into the ROM.
  82.  
  83.  When the interrupt is called, all register and flag values are pushed into the
  84. stack. The interrupt address contains a pointer into an absolute address in the
  85. ROM BIOS chip address space. This location may be further vectored into the
  86. IBMBIO.COM (or equivalent) file or user file.
  87.  
  88.  The address vector points to a particular BIOS command handler. The handler
  89. pops the register values, compares them to its list of functions, and executes
  90. the function if valid. When the function is complete, it may pass values back
  91. to the command handler. The handler will push the values into the stack and
  92. then return control to the calling program.
  93.  
  94.  Most functions will return an error code; some return more information.
  95. Details are contained in the listings for the individual functions.
  96.  
  97.  Register settings listed are the ones used by the BIOS. Some functions will
  98. return with garbage values in unused registers. Do not test for values in
  99. unspecified registers; your program may exhibit odd behavior.
  100.  
  101.  
  102.  Three sets of BIOS routines are available: PC BIOS, AT BIOS (also called
  103. CBIOS or "Old compatibility BIOS", and the PS/2 ABIOS "Advanced BIOS".
  104.  
  105.  The Advanced BIOS is contained in PS/2 ROMs. It is primarily intended for OS
  106. use rather than application use. OS/2 can take advantage of ABIOS routines to
  107. reduce RAM use on PS/2 systems. The ABIOS can be replaced by disk and RAM based
  108. ABIOS code if desired. There is a new BIOS Data Area defined in high memory
  109. that occupies one K of RAM. In OS/2 systems, parts of the ABIOS are replaced
  110. by OS/2 drivers.
  111.  
  112.  While the CBIOS must be addressed via pointers, the routines in the ABIOS are
  113. fixed in absolute locations so they can be referenced directly by OS/2.
  114.  
  115.  The ABIOS can run in protected mode, and is fully reentrant. It supports three
  116. types of function requests - single staged, discrete multistaged, or continuous
  117. multistaged. A single-staged request does its job immediately and returns
  118. control to the caller. A discrete multistaged request may happen in two or more
  119. stages with pauses between the stages. The caller may regain control during the
  120. pauses. A continuous multistaged request starts a staged operation that never
  121. ends. (sometimes called a daemon).
  122.  
  123.  Unlike the CBIOS which is called with software interrupts, ABIOS is accessed
  124. with FAR calls. ABIOS calls are completely reentrant in both real and
  125. protected modes. To call an ABIOS function, the calling program must pass
  126. pointers to two data structures - a request block and a common data area. The
  127. request block specifies the desired function number and the common data area is
  128. a table that contains pointers to all the ABIOS' other tables and data areas.
  129. The common data area's internal structure contains the function transfer
  130. tables which have the addresses of the BIOS routines.
  131.  
  132. ABIOS stack frame and calling conventions:
  133.        bytes        stack contents
  134.         2       common data area pointer (segment/selector only) required
  135.         4       request block pointer - required
  136.         4       function transfer table pointer - furnished by ABIOS or caller
  137.         4       device block pointer - furnished by ABIOS or caller
  138.         4       return address
  139.  
  140.  In ABIOS Transfer Convention, only the first two items are required. ABIOS
  141. assigns the second two. In Operating System Transfer Convention, the caller
  142. provides the second two. Since the parameters are not removed from the stack
  143. on return to the caller, the operating system may save the function transfer
  144. table and device addresses after they have been furnished by the ABIOS by a
  145. call.
  146.  
  147.  ABIOS does no interrupt arbitration. It assumes all interrupts are handled by
  148. the caller or the OS and it is called only for service. If more than one
  149. device is sharing a hardware interrupt, the OS must determine which interrupt
  150. is valid for the ABIOS.
  151.  
  152.  OS/2 may use the ABIOS if found, but otherwise duplicates the BIOS calls for
  153. the DOS Compatibility Box by vectoring BIOS calls into its own device drivers.
  154. This makes it rather difficult for DOS drivers for mass storage, high
  155. resolution video boards, multitasking APIs using int 15h, etc. If your
  156. software needs to manipulate hardware directly you might want to check if your
  157. code is running under OS/2. The simplest method is to check for DOS version 10
  158. or higher.
  159.  
  160.  
  161. note    Some references list an "XT/2" machine, which was reputedly an 8mHz
  162.         8088 with 640k and a clock on the motherboard. IBM doesn't list such
  163.         a machine, and I have a late '86 XT, one of the last made. It is
  164.         pretty much like the older ones.
  165.  
  166.  
  167. ┌─────────────────────────────────────────────────────────────────────────────┐
  168. │Interrupt 10h  Video Services                                          3**2  │
  169. └─────────────────────────────────────────────────────────────────────────────┘
  170. (0:0040h)       The BIOS Video Services may be found in Chapter 16.
  171.  
  172. (internal) Coprocessor Error (80286+)
  173.         Generated by the CPU when the -ERROR pin is asserted by the coprocessor
  174.         (usually 80x87, but may be any multimaster CPU or alternate NDP such
  175.         as Weitek, etc.). ATs and clones usually wire the coprocessor to use
  176.         IRQ13, but not all get it right.
  177.  
  178.  
  179.  
  180. ┌─────────────────────────────────────────────────────────────────────────────┐
  181. │Interrupt 11h  Equipment Check                                         3**3  │
  182. └─────────────────────────────────────────────────────────────────────────────┘
  183. (0:0044h)       Reads the BIOS Data Area and returns two bytes of setup info.
  184. entry   no parameters are required
  185. return  AX      Equipment listing word. Bits are:
  186.                 0       number of floppy drives
  187.                         0       no drives
  188.                         1       bootable (IPL) diskette drive installed
  189.                 1       math chip
  190.                         0       no math coprocessor (80x87) present
  191.                         1       math coprocessor (80x87) present
  192.          (PS/2) 2       0       mouse not installed
  193.                         1       mouse installed
  194.           (PC)  2,3     system board RAM
  195.                         0,0     16k    (PC-0, PC-1)
  196.                         0,1     32k
  197.                         1,0     48k
  198.                         1,1     64k    (PC-2, XT)
  199.                         note 1) not commonly used. Set both bits to 1
  200.                              2) both bits always 1 in AT
  201.                 4,5     initial video mode
  202.                         0,0     no video installed (use with dumb terminal)
  203.                         0,1     40x25 color      (CGA)
  204.                         1,0     80x25 color      (CGA, EGA, PGA, MCGA, VGA)
  205.                         1,1     80x25 monochrome (MDA or Hercules, most super-
  206.                                                   hires mono systems)
  207.                 6,7     number of diskette drives (only if bit 0 is 1)
  208.                         0,0     1 drives
  209.                         0,1     2 drives
  210.                         1,0     3 drives
  211.                         1,1     4 drives
  212.                 8       0       DMA present
  213.                         1       no DMA (PCjr, some Tandy 1000s, 1400LT)
  214.                 9,A,B   number of RS232 serial ports (0-3)
  215.                         0,0,0   none
  216.                         0,0,1   1
  217.                         0,1,0   2
  218.                         0,1,1   3
  219.                         1,0,0   4
  220.                 C       0       no game I/O attached
  221.                         1       game I/O attached (default for PCjr)
  222.                 D       serial accessory installation
  223.                         0       no serial accessories installed
  224.                         1       Convertible - internal modem installed
  225.                                 or PCjr - serial printer attached
  226.                 E,F     number of parallel printers
  227.                         0,0     none
  228.                         0,1     one   (LPT1, PRN)
  229.                         1,0     two   (LPT2)
  230.                         1,1     three (LPT3)
  231.                         note    Models before PS/2 would allow a fourth
  232.                                 parallel printer. Remapping of the BIOS in the
  233.                                 PS/2s does not allow the use of LPT4.
  234.         (386 extended AX)
  235.                 23d     0       Weitek ABACUS - virtual '86 EMS page tables
  236.                                 not correctly initialized
  237.                         1       Weitek ABACUS - virtual '86 EMS page tables OK
  238.  
  239.                 24d     0       Weitek ABACUS NDP not present
  240.                         1       Weitek ABACUS NDP present
  241.  
  242.  
  243.  
  244.  
  245. ┌─────────────────────────────────────────────────────────────────────────────┐
  246. │Interrupt 12h  Memory Size                                             3**4  │
  247. └─────────────────────────────────────────────────────────────────────────────┘
  248. (0:0048h)       get system memory
  249. entry   no parameters required
  250. return  AX      number of contiguous 1K RAM blocks available for DOS
  251. note 1) This is the same value stored in absolute address 04:13h.
  252.      2) For some early PC models, the amount of memory returned by this call is
  253.         determined by the settings of the dip switches on the motherboard and
  254.         may not reflect all the memory that is physically present.
  255.      3) For the PC/AT, the value returned is the amount of functional memory
  256.         found during the power-on self-test, regardless of the memory size
  257.         configuration information stored in CMOS RAM.
  258.      4) The value returned does not reflect any extended memory (above the 1 Mb
  259.         boundary) that may be present on 80286 or 80386 machines.
  260.  
  261.  
  262.  
  263.  
  264. ┌─────────────────────────────────────────────────────────────────────────────┐
  265. │Interrupt 13h  Disk Functions                                          3**5  │
  266. └─────────────────────────────────────────────────────────────────────────────┘
  267. (0:0049h)       The service calls for BIOS disk functions are located in
  268.                 Chapter 8.
  269.  
  270.  
  271.  
  272.  
  273. ┌─────────────────────────────────────────────────────────────────────────────┐
  274. │Interrupt 14h  Initialize and Access Serial Port For Int 14            3**6  │
  275. └─────────────────────────────────────────────────────────────────────────────┘
  276.  Note:  Some IBM PS/2 Model 50Z machines were delivered with serial ports
  277.         that did not meet specification.  Some cheap clone serial ports may
  278.         also be troublesome.
  279.  
  280. (0:0050h)       the following status is defined:
  281.  
  282.         serial status byte:
  283.         bits    0 delta clear to send
  284.                 1 delta data set ready
  285.                 2 trailing edge ring detector
  286.                 3 delta receive line signal detect
  287.                 4 clear to send
  288.                 5 data set ready
  289.                 6 ring indicator
  290.                 7 receive line signal detect
  291.  
  292.         line status byte:
  293.         bits    0 data ready
  294.                 1 overrun error
  295.                 2 parity error
  296.                 3 framing error
  297.                 4 break detect
  298.                 5 transmit holding register empty
  299.                 6 transmit shift register empty
  300.                 7 time out  note: if bit 7 set then other bits are invalid
  301.  
  302.         Though present on the IBM PS/2s, COM3 and COM4 are not widely
  303.         standardized across the industry. The most common definitions are:
  304.  
  305.         port    addr.   IRQ     interrupt
  306.  
  307.         COM1    3F8     IRQ4    int 0Ch
  308.         COM2    2F8     IRQ3    int 0Bh
  309.         COM3    3E8     IRQ4    int 0Ch
  310.         COM4    2E8     IRQ3    int 0Bh
  311.  
  312.         As you can see, COM1/COM3 and COM2/COM4 are siamesed.  Since the ISA
  313.         bus does not support shared interrupts, simultaneous access of two of
  314.         a pair may cause conflict.  For example, a mouse and a modem would not
  315.         coexist well on paired ports.
  316.  
  317.  
  318.  All routines have AH=function number and DX=RS232 card number (0 based).
  319. AL=character to send or received character on exit, unless otherwise noted.
  320.  
  321. entry   AH      00h     Initialize And Access Serial Communications Port
  322.                         bit pattern: BBBPPSLL
  323.                         BBB = baud rate:   110,150,300,600,1200,2400,4800,9600
  324.                         PP  = parity:      01 = odd, 11 = even
  325.                         S   = stop bits:   0 = 1, 1 = 2
  326.                         LL  = word length: 10 = 7-bits, 11 = 8-bits
  327.         AL      parms for initialization:
  328.                 bit pattern:
  329.                 0       word length
  330.                 1       word length
  331.                 2       stop bits
  332.                 3       parity
  333.                 4       parity
  334.                 5       baud rate
  335.                 6       baud rate
  336.                 7       baud rate
  337.                 word length     10      7 bits
  338.                                 11      8 bits
  339.                 stop bits       0       1 stop bit
  340.                                 1       2 stop bits
  341.                 parity          00      none
  342.                                 01      odd
  343.                                 11      even
  344.                 baud rate       000     110 baud
  345.                                 001     150 baud
  346.                                 010     300 baud
  347.                                 011     600 baud
  348.                                 100     1200 baud
  349.                                 101     2400 baud
  350.                                 110     4800 baud
  351.                                 111     9600 baud  (4800 on PCjr)
  352.         DX      port number (0=COM1, 1=COM2, etc.)
  353. return  AH      line status
  354.         AL      modem status
  355. note    To initialize the serial port to > 9600 baud on PS/2 machines, see
  356.         fns 04h and 05h.
  357.  
  358.  
  359. Function 01h    Send Character in AL to Comm Port
  360. entry   AH      01h
  361.         AL      character
  362.         DX      port number (0 - 3)
  363. return  AH      RS232 status code
  364.                 bit     0       data ready
  365.                         1       overrun error
  366.                         2       parity error
  367.                         3       framing error
  368.                         4       break detected
  369.                         5       transmission buffer register empty
  370.                         6       transmission shift register empty
  371.                         7       timeout
  372.         AL      modem status
  373.                 bit
  374.                         0       delta clear-to-send
  375.                         1       delta data-set-ready
  376.                         2       trailing edge ring detected
  377.                         3       change, receive line signal detected
  378.                         4       clear-to-send
  379.                         5       data-set-ready
  380.                         6       ring received
  381.                         7       receive line signal detected
  382.  
  383.  
  384. Function 02h    Wait For A Character From Comm Port DX
  385. entry   AH      02h
  386.         DX      port number (0-3)
  387. return  AL      character received
  388.         AH      error code (see above)(00h for no error)
  389.  
  390.  
  391. Function 03h    Fetch the Status of Comm Port DX (0 or 1)
  392. entry   AH      03h
  393.         DX      port (0-3)
  394. return  AH      set bits (01h) indicate comm-line status
  395.                 bit     7       timeout
  396.                 bit     6       empty transmit shift register
  397.                 bit     5       empty transmit holding register
  398.                 bit     4       break detected ("long-space")
  399.                 bit     3       framing error
  400.                 bit     2       parity error
  401.                 bit     1       overrun error
  402.                 bit     0       data ready
  403.         AL      set bits indicate modem status
  404.                 bit     7       received line signal detect
  405.                 bit     6       ring indicator
  406.                 bit     5       data set ready
  407.                 bit     4       clear to send
  408.                 bit     3       delta receive line signal detect
  409.                 bit     2       trailing edge ring detector
  410.                 bit     1       delta data set ready
  411.                 bit     0       delta clear to send
  412.  
  413.  
  414. Function 04h    Extended Initialize                       (Convertible, PS/2)
  415. entry   AH      04h
  416.         AL      break status
  417.                 01h     if break
  418.                 00h     if no break
  419.         BH      parity
  420.                 00h     no parity
  421.                 01h     odd parity
  422.                 02h     even parity
  423.                 03h     stick parity odd
  424.                 04h     stick parity even
  425.         BL      number of stop bits
  426.                 00h     one stop bit
  427.                 01h     2 stop bits (1½ if 5 bit word length)
  428.         CH      word length
  429.                 00h     5 bits
  430.                 01h     6 bits
  431.                 02h     7 bits
  432.                 03h     8 bits
  433.         CL      baud rate
  434.                 00h     110
  435.                 01h     150
  436.                 02h     300
  437.                 03h     600
  438.                 04h     1200
  439.                 05h     2400
  440.                 06h     4800
  441.                 07h     9600
  442.                 08h     19200
  443.         DX      comm port (0-3)
  444. return  AH      line control status
  445.         AL      modem status
  446. note    Provides a superset of fn 00h capabilities for PS/2 machines.
  447.  
  448.  
  449. Function 05h    Extended Communication Port Control       (Convertible, PS/2)
  450. entry   AH      05h
  451.         AL      00h     read modem control register
  452.                 01h     write modem control register
  453.         BL      modem control register
  454.            bits 0       DTR data terminal ready
  455.                 1       RTS request to send
  456.                 2       out1
  457.                 3       out2
  458.                 4       loop
  459.                 5,6,7   reserved
  460.         DX      port number (0=COM1, 1=COM2, etc.)
  461. return  AH      port status (see 00h above)
  462.         AL      modem status (see 00h above)
  463.         BL      modem control register (see 01h above)
  464.  
  465.  
  466.  
  467. FOSSIL Drivers ........................................................ 3**7
  468.  
  469. Interrupt  14h  FOSSIL (Fido/Opus/Seadog Standard Interface Level) drivers
  470.                 A FOSSIL is a device driver for handling the IBM PC serial
  471.                 communications ports in a standard fashion from an application
  472.                 (communications) program. A FOSSIL chains into the int 14h BIOS
  473.                 communications vector and replaces many functions with enhanced
  474.                 routines that may be easily accessed by an application.
  475.  
  476.                 For all functions, all registers not specifically containing a
  477.                 function return value must be preserved across the call.
  478.  
  479.  
  480. entry   AH      00h     Set baud rate and parameters
  481.         AL      byte
  482.                 bits 7,6,5 baudrate
  483.                 000     19200 baud
  484.                 001     38400 baud
  485.                 010     300 baud
  486.                 011     600 baud
  487.                 100     1200 baud
  488.                 101     2400 baud
  489.                 110     4800 baud
  490.                 111     9600 baud
  491.                 bits 4,3 parity
  492.                 00      none
  493.                 01      odd
  494.                 10      none
  495.                 11      even
  496.                 bit 2 stop bits
  497.                 0       1 stop bit
  498.                 1       2 stop bits
  499.                 bit 1 char length
  500.                 0       5 bits plus value
  501.                 other   optional
  502.         DX      port number (NOP if DX=00FFh)
  503. return  AX      status (see fn 03h)
  504. note    Low-order 5 bits are undefined by FOSSIL 1.0 spec.
  505.  
  506.  
  507. entry   AH      01h     Transmit character with wait
  508.         AL      ASCII value of character to be sent
  509.         DX      port number (NOP if DX=00FFh)
  510. return  AX      status bits (see function 03h)
  511. note 1) Character is queued for transmission. If there is room in the
  512.         transmitter buffer when this call is made, the character will be stored
  513.         and control returned to caller. If the buffer is full, the driver will
  514.         wait for room. Use this function with caution when flow control is
  515.         enabled.
  516.  
  517.  
  518. entry   AH      02h     FOSSIL: Receive a character with wait
  519.         DX      port number (0-3) (NOP if DX=00FFh)
  520. return  AH      RS-232 status code (see AH=00h above)
  521.         AL      ASCII value of character received from serial port
  522. note    Will timeout if DSR is not asserted, even if function 03h returns
  523.         data ready.
  524.  
  525.  
  526. entry   AH      03h     FOSSIL: Request status
  527.         DX      port number  (NOP if DX=00FFh)
  528. return  AX      status bit mask
  529.                 AH      bit 0 set  RDA     input data is available in buffer
  530.                             1 set  OVRN    input buffer overrun
  531.                             2 N/A
  532.                             3 N/A
  533.                             4 N/A
  534.                             5 set  THRE    room is available in output buffer
  535.                             6 set  TSRE    output buffer is empty
  536.                             7 N/A
  537.                 AL      bit 0 N/A
  538.                             1 N/A
  539.                             2 N/A
  540.                             3 set          this bit is always set
  541.                             4 N/A
  542.                             5 N/A
  543.                             6 N/A
  544.                             7 set  DCD     carrier detect
  545. note    Bit 3 of AL is always returned set to enable programs to use it as a
  546.         carrier detect bit on hardwired (null modem) links.
  547.  
  548.  
  549. entry   AH      04h     Initialize FOSSIL driver
  550.         BX      4F50h                      (optional)
  551.         DX      port number                (DX=00FFh special)
  552.         ES:CX   pointer to ^C flag address (optional)
  553. return  AX      1954h if successful
  554.         BL      maximum function number supported (excluding 7Eh-0BFh)
  555.         BH      revision of FOSSIL supported
  556. note 1) DTR is raised when FOSSIL inits.
  557.      2) Existing baudrate is preserved.
  558.      3) If BX contains 4F50h, the address specified in ES:CX is that of a ^C
  559.         flag byte in the application program, to be incremented when ^C is
  560.         detected in the keyboard service routines. This is an optional service
  561.         and only need be supported on machines where the keyboard service can't
  562.         (or won't) perform an int 1Bh or int 23h when a control-C is entered.
  563.  
  564.  
  565. entry   AH      05h     Deinitialize FOSSIL driver
  566.         DX      port number  (DX=00FFh special)
  567. return  none
  568. note 1) DTR is not affected.
  569.      2) Disengages driver from comm port. Should be done when operations on the
  570.         port are complete.
  571.      3) If DX=00FFh, the initialization that was performed when FOSSIL function
  572.         04h with DX=00FFh should be undone.
  573.  
  574.  
  575. entry   AH      06h     FOSSIL: Raise/lower DTR
  576.         AL      DTR state to be set
  577.                 00h     lower DTR
  578.                 01h     raise DTR
  579.         DX      comm port (NOP if DX=00FFh)
  580. return  none
  581.  
  582.  
  583. entry   AH      07h     FOSSIL: Return timer tick parameters
  584. return  AH      ticks per second on interrupt number shown in AL
  585.         AL      timer tick interrupt number (not vector!)
  586.         DX      milliseconds per tick (approximate)
  587.  
  588.  
  589. entry   AH      08h     FOSSIL: Flush output buffer
  590.         DX      port number (NOP if DX=00FFh)
  591. return  none
  592. note    Waits until all output is done.
  593.  
  594.  
  595. entry   AH      09h     FOSSIL: Purge output buffer
  596.         DX      port number (NOP if DX=00FFh)
  597. return  none
  598. note    Returns to caller immediately.
  599.  
  600.  
  601. entry   AH      0Ah     FOSSIL: Purge input buffer
  602.         DX      port number (NOP if DX=00FFh)
  603. return  none
  604. note 1) If any flow control restraint has been employed (dropping RTS or
  605.         transmitting XOFF) the port will be "released" by doing the reverse,
  606.         raising RTS or sending XON.
  607.      2) Returns to caller immediately.
  608.  
  609.  
  610. entry   AH      0Bh     FOSSIL: Transmit no wait
  611.         AL      ASCII character value to be sent
  612.         DX      port number (NOP if DX=00FFh)
  613. return  AX      0000h   character not accepted
  614.                 0001h   character accepted
  615. note    This is exactly the same as the "regular" transmit call except that if
  616.         there is no space available in the output buffer a value of zero is
  617.         returned in AX, if room is available a value 1 (one) is returned.
  618.  
  619.  
  620. entry   AH      0Ch     FOSSIL: Nondestructive Read no Wait
  621.         DX      port number (NOP if DX=00FFh)
  622. return  AH      character
  623.                 0FFFFh  character not available
  624. note 1) Reads async buffer.
  625.      2) Does not remove keycode from buffer.
  626.  
  627.  
  628. entry   AH      0Dh     FOSSIL: Keyboard read no wait
  629. return  AX      IBM keyboard scan code or
  630.                 0FFFFh if no keyboard character available
  631. note 1) Use IBM-style function key mapping in the high order byte.
  632.      2) Scan codes for non function keys are not specifically required but may
  633.         be included.
  634.      3) Does not remove keycode from buffer.
  635.  
  636.  
  637. entry   AH      0Eh     FOSSIL: Keyboard input with wait
  638. return  AX      IBM keyboard scan code
  639. note    Returns the next character from the keyboard or waits if no character
  640.         is available.
  641.  
  642.  
  643. entry   AH      0Fh     Enable or Disable flow control
  644.         AL      bit mask describing requested flow control
  645.            bits 0       XON/XOFF on transmit (watch for XOFF while sending)
  646.                 1       CTS/RTS (CTS on transmit/RTS on receive)
  647.                 2       reserved
  648.                 3       XON/XOFF on receive (send XOFF when buffer near full)
  649.                 4-7     not used, FOSSIL spec calls for setting to 1
  650.         DX      port number (NOP if DX=00FFh)
  651. return  none
  652. note 1) Bit 2 is reserved for DSR/DTR,  but is not currently supported in any
  653.         implementation.
  654.      2) TRANSMIT flow control allows the other end to restrain the transmitter
  655.         when you are overrunning it. RECEIVE flow control tells the FOSSIL to
  656.         attempt to do just that if it is being overwhelmed.
  657.      3) Enabling transmit Xon/Xoff will cause the FOSSIL to stop transmitting
  658.         upon receiving an Xoff. The FOSSIL will resume transmitting when an Xon
  659.         is received.
  660.      4) Enabling CTS/RTS will cause the FOSSIL to cease transmitting when CTS
  661.         is lowered. Transmission will resume when CTS is raised. The FOSSIL
  662.         will drop RTS when the receive buffer reaches a predetermined
  663.         percentage full. The FOSSIL will raise RTS when the receive buffer
  664.         empties below the predetermined percentage full. The point(s) at which
  665.         this occurs is left to the individual FOSSIL implementor.
  666.      5) Enabling receive Xon/Xoff will cause the FOSSIL to send a Xoff when the
  667.         receive buffer reaches a pre-determined percentage full. An Xon will be
  668.         sent when the receive buffer empties below the predetermined percentage
  669.         full. The point(s) at which this occurs is left to the individual
  670.         FOSSIL implementor.
  671.      6) Applications using this function should set all bits ON in the high
  672.         nibble of AL as well. There is a compatible (but not identical) FOSSIL
  673.         driver implementation that uses the high nibble as a control mask. If
  674.         your application sets the high nibble to all ones, it will always work,
  675.         regardless of the method used by any given driver.
  676.  
  677.  
  678. entry   AH      10h     Extended Ctrl-C/Ctrl-K checking and transmit on/off
  679.         AL      flags bit mask byte (bit set if activated)
  680.            bits 0       enable/disable Ctrl-C/Ctrl-K checking
  681.                 1       disable/enable the transmitter
  682.                 2-7     not used
  683.         DX      port number (NOP if DX=00FFh)
  684. return  AX      status byte
  685.                 0000h   control-C/K has not been received
  686.                 0001h   control-C/K has been received
  687. note    This is used primarily for programs that can't trust XON/XOFF at FOSSIL
  688.         level (such as BBS software).
  689.  
  690.  
  691. entry   AH      11h     FOSSIL: Set current cursor location.
  692.         DH      row (line) 0-24
  693.         DL      column     0-79
  694. return  none
  695. note 1) This function looks exactly like the int 10h, fn 02h on the IBM PC.
  696.         The cursor location is passed in DX: row in DH and column in DL. This
  697.         function treats the screen as a coordinate system whose origin (0,0) is
  698.         the upper left hand corner of the screen.
  699.      2) Row and column start at 0.
  700.  
  701.  
  702. entry   AH      12h     FOSSIL: Read current cursor location.
  703. return  DH      row (line)
  704.         DL      column
  705. note 1) Looks exactly like int 10h/fn 03h in the IBM PC BIOS. The current
  706.         cursor location (same coordinate system as function 16h) is passed back
  707.         in DX.
  708.      2) Row and column start at 0.
  709.  
  710.  
  711. entry   AH      13h     FOSSIL: Single character ANSI write to screen.
  712.         AL      value of character to display
  713. return  none
  714. note    This call might not be reentrant since ANSI processing may be through
  715.         DOS.
  716.  
  717.  
  718. entry   AH      14h     FOSSIL: Enable or disable watchdog processing
  719.         AL      00h     to disable watchdog
  720.                 01h     to enable watchdog
  721.         DX      port number (NOP if DX=00FFh)
  722. return  none
  723. note 1) This call will cause the FOSSIL to reboot the system if Carrier Detect
  724.         for the specified port drops while watchdog is turned on.
  725.      2) The port need not be active for this function to work.
  726.  
  727.  
  728. entry   AH      15h     Write character to screen using BIOS support routines
  729.         AL      ASCII code of character to display
  730. return  none
  731. note 1) This function is reentrant.
  732.      2) ANSI processing may not be assumed.
  733.  
  734.  
  735. entry   AH      16h     Insert or Delete a function from the timer tick chain
  736.         AL      00h     to delete a function
  737.                 01h     to add a function
  738.         ES:DX   address of function
  739. return  AX      0000h   successful
  740.                 0FFFFh  unsuccessful
  741.  
  742.  
  743. entry   AH      17h     FOSSIL: Reboot system
  744.         AL      boot type
  745.                 00h     cold boot
  746.                 01h     warm boot
  747. return  none
  748.  
  749.  
  750. entry   AH      18h     FOSSIL: Read block
  751.         CX      maximum number of characters to transfer
  752.         DX      port number (NOP if DX=00FFh)
  753.         ES:DI   pointer to user buffer
  754. return  AX      number of characters transferred
  755. note 1) This function does not wait for more characters to become available if
  756.         the value in CX exceeds the number of characters currently stored.
  757.      2) ES:DI are left unchanged by the call; the count of bytes actually
  758.         transferred will be returned in AX.
  759.  
  760.  
  761. entry   AH      19h     FOSSIL: Write block
  762.         CX      maximum number of characters to transfer
  763.         DX      port number  (NOP if DX=00FFh)
  764.         ES:DI   pointer to user buffer
  765. return  AX      number of characters transfered
  766. note    ES and DI are not modified by this call.
  767.  
  768.  
  769. entry   AH      1Ah     FOSSIL: Break signal begin or end
  770.         AL      00h     stop sending 'break'
  771.                 01h     start sending 'break'
  772.         DX      port number  (NOP if DX=00FFh)
  773. return  none
  774. note 1) Resets all transmit flow control restraints such as an XOFF received
  775.         from remote.
  776.      2) Init (fn 04h) or UnInit (fn 05h) will stop an in-progress break.
  777.      3) The application must determine the "length" of the break.
  778.  
  779.  
  780. entry   AH      1Bh     FOSSIL: Return information about the driver
  781.         CX      size of user buffer in bytes
  782.         DX      port number  (if DX=00FFh, port data will not be valid)
  783.         ES:DI   pointer to user buffer
  784. return  AX      number of characters transferred
  785.         ES:DI   user buffer structure:
  786.                 00h     word    size of structure in bytes
  787.                 02h     byte    FOSSIL driver version
  788.                 03h     byte    revision level of this specific driver
  789.                 04h     dword   FAR pointer to ASCII ID string
  790.                 08h     word    size of the input buffer in bytes
  791.                 0Ah     word    number of bytes in input buffer
  792.                 0Ch     word    size of the output buffer in bytes
  793.                 0Eh     word    number of bytes in output buffer
  794.                 10h     byte    width of screen in characters
  795.                 11h     byte    screen height in characters
  796.                 12h     byte    actual baud rate, computer to modem
  797.                                 (see mask in function 00h
  798. note 1) The baud rate byte contains the bits that fn 00h would use to set the
  799.         port to that speed.
  800.      2) The fields related to a particular port (buffer size, space left in the
  801.         buffer, baud rate) will be undefined if port=0FFh or an invalid port is
  802.         contained in DX.
  803.      3) Additional information will always be passed after these, so that the
  804.         fields will never change with FOSSIL revision changes.
  805.  
  806.  
  807. entry   AH      7Eh     FOSSIL: Install an external application function
  808.         AL      code assigned to external application
  809.         ES:DX   pointer to entry point
  810. return  AX      1954h   FOSSIL driver present
  811.             not 1954h   FOSSIL driver not present
  812.         BH      00h     failed
  813.                 01h     successful
  814.         BL      code assigned to application (same as input AL)
  815. note 1) Application codes 80h-0BFh are supported. Codes 80h-83h are reserved.
  816.      2) An error code of BH=00h with AX=1954h should mean that another external
  817.         application has already been installed with the code specified in AL.
  818.      3) Applications are entered via a FAR call and should make a FAR return.
  819.  
  820.  
  821. entry   AH      7Fh     FOSSIL: Remove an external application function
  822.         AL      code assigned to external application
  823.         ES:DX   pointer to entry point
  824. return  AX      1954h
  825.         BH      00h     failed
  826.                 01h     successful
  827.         BL      code assigned to application (same as input AL)
  828.  
  829.  
  830.  
  831. ┌─────────────────────────────────────────────────────────────────────────────┐
  832. │Interrupt 15h  Cassette I/O                                            3**8  │
  833. └─────────────────────────────────────────────────────────────────────────────┘
  834. (0:0054h)    1) Renamed "System Services" on PS/2 line.
  835.              2) Issuing int 15h on an XT may cause a system crash.
  836.                 On AT and after, interrupts are disabled with CLI when the
  837.                 interrupt service routine is called, but most ROM versions do
  838.                 not restore interrupts with STI.
  839.              3) For the original IBM PC, int 15h returns AH=80h and CF set for
  840.                 all calls with AH not 0,1, or 2.
  841.              4) For the PC/XT int 15h returns AH=86h, CF set if called at all.
  842.                 (the PC/XT ROM BIOS does not support int 15h)
  843.              5) For the AT/339, int 15h returns AH=86h, CF set if called with
  844.                 an invalid function code.
  845.  
  846.  
  847. Function 00h    Turn Cassette Motor On                          (PC, PCjr only)
  848. entry   AH      00h
  849. return  CF      set on error
  850.                 AH      error code
  851.                         00h     no errors
  852.                         01h     CRC error
  853.                         02h     bad tape signals
  854.                                 no data transitions (PCjr)
  855.                         03h     no data found on tape
  856.                                 not used (PCjr)
  857.                         04h     no data
  858.                                 no leader (PCjr)
  859.                         80h     invalid command
  860.                         86h     no cassette present
  861.                                 not valid in PCjr
  862. note    NOP for systems where cassette not supported.
  863.  
  864.  
  865. Function 01h    Turn Cassette Motor Off                         (PC, PCjr only)
  866. entry   AH      01h
  867. return  CF      set on error
  868.         AH      error code (86h)
  869. note    NOP for systems where cassette not supported.
  870.  
  871.  
  872. Function 02h    Read Blocks From Cassette                       (PC, PCjr only)
  873. entry   AH      02h
  874.         CX      number of bytes to read
  875.         ES:BX   segment:offset + 1 of last byte read
  876. return  CF      set on error
  877.                 AH      error code (01h, 02h, 04h, 80h, 86h)
  878.         DX      count of bytes actually read
  879.         ES:BX   pointer past last byte written
  880. note 1) NOP for systems where cassette not supported.
  881.      2) Cassette operations normally read 256 byte blocks.
  882.  
  883.  
  884. Function 03h    Write Data Blocks to Cassette                   (PC, PCjr only)
  885. entry   AH      03h
  886.         CX      count of bytes to write
  887.         ES:BX   pointer to data buffer
  888. return  CF      set on error
  889.                 AH      error code (80h, 86h)
  890.         CX      00h
  891.         ES:BX   pointer to last byte written+1
  892. note 1) NOP for systems where cassette not supported.
  893.      2) The last block is padded to 256 bytes with zeroes if needed.
  894.      3) No errors are returned by this service.
  895.  
  896.  
  897. Function 0Fh    ESDI Format Unit Periodic Interrupt          (PS/2 50+)
  898. entry   AH      0Fh
  899.         AL      phase code
  900.                 00h     reserved
  901.                 01h     surface analysis
  902.                 02h     formatting
  903. return  CF      clear   if formatting should continue
  904.                 set     if it should terminate
  905. note 1) Called the BIOS on the ESDI Fixed Disk Drive Adapter/A during a format
  906.         or surface analysis operation after each cylinder is completed.
  907.      2) This function call can be captured by a program so that it will be
  908.         notified as each cylinder is formatted or analyzed. The program can
  909.         count interrupts for each phase to determine the current cylinder
  910.         number.
  911.      3) The BIOS default handler for this function returns with CF set.
  912.  
  913.  
  914. Function 10h    TopView API Function Calls                      (TopView)
  915.                 see Chapter 17
  916.  
  917.  
  918. Function 20h    PRINT.COM  (DOS 3.1+ internal)         (AT, XT/286, PS/2 50+)
  919. entry   AH      20h
  920.         AL      subfunction
  921.                 00h     disable critical region flag
  922.                 01h     set critical region flag
  923.                         ES:BX   pointer to flag byte set while inside DOS calls
  924.                 10h     set up SysReq routine
  925.                 11h     completion of SysReq routine (software only)
  926.  
  927.  
  928. Function 21h    Read Power-On Self Test (POST) Error Log           (PS/2 50+)
  929. entry   AH      21h
  930.         AL      00h     read POST log
  931.                 01h     write POST log
  932.                         BH      device ID
  933.                         BL      device error code
  934. return  CF      set on error
  935.         AH      status
  936.                 00h     successful read
  937.                         BX      number of POST error codes stored
  938.                         ES:DI   pointer to error log
  939.                 01h     list full
  940.                 80h     invalid command
  941.                 86h     function unsupported
  942. note    The log is a series of words, the first byte of which identifies the
  943.         error code and the second is the device ID.
  944.  
  945.  
  946. Function 40h    Read/Modify Profiles                            (Convertible)
  947. entry   AH      40h
  948.         AL      00h     read system profile in CX,BX
  949.                 01h     write system profile from CX, BX
  950.                 02h     read internal modem profile in BX
  951.                 03h     write internal modem profile from BX
  952.         BX      profile info
  953. return  BX      internal modem profile (from 02h)
  954.         CX,BX   system profile (from 00h)
  955.  
  956.  
  957. Function 41h    Wait On External Event                          (Convertible)
  958. entry   AH      41h
  959.         AL      condition type
  960.            bits 0-2     condition to wait for
  961.                         0,0,0   any external event
  962.                         0,0,1   compare and return if equal
  963.                         0,1,0   compare and return if not equal
  964.                         0,1,1   test and return if not zero
  965.                         1,0,0   test and return if zero
  966.                 3       reserved
  967.                 4       0       user byte
  968.                         1       port address
  969.                 5-7     reserved
  970.         BH      condition compare or mask value
  971.                 condition codes:
  972.                 00h     any external event
  973.                 01h     compare and return if equal
  974.                 02h     compare and return if not equal
  975.                 03h     test and return if not zero
  976.                 04h     test and return if zero
  977.         BL      timeout value times 55 milliseconds
  978.                 00h     if no time limit
  979.         DX      I/O port address (if AL bit 4=1)
  980.         ES:DI   pointer to user byte (if AL bit 4=0)
  981.  
  982.  
  983. Function 42h    Request System Power Off                        (Convertible)
  984. entry   AH      42h
  985.         AL      00h     to use system profile
  986.                 01h     to force suspend regardless of profile
  987. return  unknown
  988.  
  989.  
  990. Function 43h    Read System Status                              (Convertible)
  991. entry   AH      43h
  992. return  AL      status byte
  993.             bit 0       LCD detached
  994.                 1       reserved
  995.                 2       RS232/parallel powered on
  996.                 3       internal modem powered on
  997.                 4       power activated by alarm
  998.                 5       bad time
  999.                 6       external power in use
  1000.                 7       battery low
  1001.  
  1002.  
  1003. Function 44h    (De)activate Internal Modem Power               (Convertible)
  1004. entry   AH      44h
  1005.         AL      00h      to power off
  1006.                 01h      to power on
  1007. return  unknown
  1008.  
  1009.  
  1010. Function 4Fh    OS Hook - Keyboard Intercept          (except PC, PCjr, and XT)
  1011. entry   AH      4Fh
  1012.         AL      scan code, CF set
  1013. return  AL      scan code
  1014.         CF      set     processing desired
  1015.                 clear   scan code should not be used
  1016. note 1) Called by int 9 handler for each keystroke to translate scan codes.
  1017.      2) An OS or a TSR can capture this function to filter the raw keyboard
  1018.         data stream. The new handler can substitute a new scan code, return the
  1019.         same scan code, or return the carry flag clear causing the keystroke to
  1020.         be discarded. The BIOS default routine simply returns the scan code
  1021.         unchanged.
  1022.      3) A program can call int 15h/fn0C0h to determine whether the host
  1023.         machine's BIOS supports keyboard intercept.
  1024.      4) Used internally by PC-MOS/386 v4.00+ for keyboard input.
  1025.      5) Some BIOSes do not properly support this call. However, some versions
  1026.         of KEYB.COM provide additional 4Fh support.
  1027.  
  1028.  
  1029. Function 52h    MicroSoft RAM-Resident Software Specification 1.0
  1030.                 This standard was proposed by MicroSoft in 1986 as a common
  1031.                 interface for TSR programs. It appears to have been largely
  1032.                 unknown or disregarded.
  1033.  
  1034. Function 0: Get Program Information by Name
  1035. entry   DS:BX   The Program ID of the memory-resident program to look for
  1036. return  AL      0FFh    if the program we are looking for is installed
  1037.                 00h     if it is not installed
  1038.         CX      The number of this program. The first program installed is
  1039.                 number 0, with the second program being number 1, etc. By using
  1040.                 a dynamic numbering system, we avoid conflicts between programs
  1041.                 that might otherwise choose the same ID. We also provide a good
  1042.                 way to scan all the resident programs using function 1.
  1043.         ES:DX   pointer to the Program ID Record (PIDR)
  1044. note    This function tests to see if a program is memory resident and returns
  1045.         a pointer to its program information if it is resident. To use this
  1046.         function, set DS:BX to point to the program ID. Each installed program
  1047.         will check to see if this program ID agrees with its own internal
  1048.         program ID.
  1049.  
  1050. Function 1: Get Program Information by Number
  1051. entry   CX      Number of the program we want the information for
  1052.  
  1053. return  AL      0FFh    if the program we are looking for is installed
  1054.                 00h     if it is not installed
  1055.         ES:DX   pointer to the Program ID Record (PIDR)
  1056. note    This function returns exactly the same information as function 0. The
  1057.         only difference is how we identify the program we want, which is
  1058.         determined by its position in the interrupt chain; program 0 is the
  1059.         last program in the chain, and the first program in the chain (usually
  1060.         the most recently installed) has the highest number.
  1061.  
  1062. Function 2: Activate Program
  1063. entry   CX      The number of the program we want to activate
  1064.         DS:BX   Activation Record. This record will give program information on
  1065.                 how and what it should activate within the program
  1066. return  none
  1067. note    This function activates one of the installed programs. It is useful
  1068.         if you want to control many desk accessories with a single control
  1069.         panel like the one used in SideKick. You can also use it with a
  1070.         program like ProKey to run a named macro under program control, or
  1071.         with SideKick to bring up one of the desk accessories from within a
  1072.         program or batch file.
  1073.  
  1074. Function 3: Deactivate Program
  1075. entry   CX      The number of the program we want to deactivate
  1076.         DS:BX   Deactivation Record. This record will give program information
  1077.                 on how and what it should deactivate within the program
  1078. return  none
  1079. note    This function is the opposite of function 2 (activate program).
  1080.  
  1081. Function 4: Enable Program
  1082. entry   CX      The number of the program we want to enable
  1083.         DS:BX   Enable mask record. This mask describes what features we want
  1084.                 to enable. A null record enables all the features.
  1085. return  none
  1086. note    This function is the opposite of function 5 (disable program).
  1087.  
  1088. Function 5: Disable Program
  1089. entry   CX      The number of the program we want to disable
  1090.         DS:BX   Disable mask record.  This mask describes what features we want
  1091.                 to disable. A null record disables all the features.
  1092. return  none
  1093. note    Sometimes it becomes necessary to disable a program to prevent it from
  1094.         conflicting with another program, this function is designed to do that.
  1095.         This function is the opposite of function 4 (Enable Program).
  1096.  
  1097.  
  1098. Function 70h    EEROM handler                                (Tandy 1000HX)
  1099. entry   AH      00h     read from EEROM
  1100.                 BL      00h
  1101.                 01h     write to EEROM
  1102.                 BL      word number to write (0-15)
  1103.                 DX      word value to write
  1104. return  DX      (AH=00h) word value
  1105.         CF      set on error (system is not a Tandy 1000 HX)
  1106.  
  1107.  
  1108. Function 80h    OS Hook - Device Open                        (AT, XT/286, PS/2)
  1109. entry   AH      80h
  1110.         BX      device ID
  1111.         CX      process ID
  1112. return  CF      set on error
  1113.         AH      status
  1114. note 1) Acquires ownership of a logical device for a process.
  1115.      2) This call, along with fns 81h and 82h, defines a simple protocol that
  1116.         can be used to arbitrate usage of devices by multiple processes. A
  1117.         multitasking program manager would be expected to capture int 15h and
  1118.         provide the appropriate service.
  1119.      3) The default BIOS routine for this function simply returns with CF clear
  1120.         and AH=00h.
  1121.  
  1122.  
  1123. Function 81h    Device Close                               (AT, XT/286, PS/2)
  1124. entry   AH      81h
  1125.         BX      device ID
  1126.         CX      process ID
  1127. return  CF      set on error
  1128.         AH      status
  1129. note 1) Releases ownership of a logical device for a process.
  1130.      2) A multitasking program manager would be expected to capture int 15h and
  1131.         provide the appropriate service.
  1132.      3) The BIOS default routine for this function simply returns with the CF
  1133.         clear and AH=00h.
  1134.  
  1135.  
  1136. Function 82h    Program Termination                          (AT, XT/286, PS/2)
  1137.         AH      82h
  1138.         BX      device ID
  1139. return  CF      set on error
  1140.         AH      status
  1141. note 1) Closes all logical devices opened with function 80h.
  1142.      2) A multitasking program manager would be expected to capture int 15h and
  1143.         provide the appropriate service.
  1144.      3) The BIOS default routine for this function simply returns with CF clear
  1145.         and AH=00h.
  1146.  
  1147.  
  1148. Function 83h    Event Wait                 (AT, XT/286, Convertible, PS/2 50+)
  1149. entry   AH      83h
  1150.         AL      00h     to set interval
  1151.                 01h     to cancel
  1152.         CX:DX   number of microseconds to wait (granularity is 976 microseconds)
  1153.         ES:BX   pointer to semaphore flag (bit 7 is set when interval expires)
  1154.                 (pointer is to caller's memory) (some sources list bit 15 set)
  1155. return  CF      clear   OK
  1156.                 set     function already busy
  1157. note 1) Requests setting of a semaphore after a specified interval or cancels a
  1158.         previous request.
  1159.      2) The calling program is responsible for clearing the semaphore before
  1160.         requesting this function.
  1161.      3) The actual duration of an event wait is always an integral multiple of
  1162.         976 microseconds. The CMOS date/clock chip interrupts are used to
  1163.         implement this function.
  1164.      4) Use of this function allows programmed, hardware-independent delays at
  1165.         a finer resolution than can be obtained through use of the MS-DOS Get
  1166.         Time function (int 21h/fn 2Ch) which returns time in hundredths of a
  1167.         second.
  1168.      5) CX:DX is a four-byte integer.
  1169.      7) This function is called by int 70h and is not the normal Int 08h/1Ch
  1170.         clock tick. It is generated by the MC146818A Real Time Clock chip.
  1171.         This is the battery backed up CMOS clock chip.
  1172.  
  1173.  
  1174. Function 84h    Read Joystick Input Settings                 (AT, XT/286, PS/2)
  1175. entry   AH      84h
  1176.         DX      00h     to read the current switch settings  (return in AL)
  1177.                 01h     to read the resistive inputs
  1178. return  CF      set on error
  1179.         (fn 00h)
  1180.         AL      switch settings (bits 7-4)
  1181.         (fn 01h)
  1182.         AX      stick A (X) value
  1183.         BX      stick A (Y) value
  1184.         CX      stick B (X) value
  1185.         DX      stick B (Y) value
  1186. note 1) An error is returned if DX does not contain a valid subfunction number.
  1187.      2) If no game adapter is installed, all returned values are 00h.
  1188.      3) Using a 250K Ohm joystick, the potentiometer values usually lie within
  1189.         the range 0-416 (0000h-01A0h).
  1190.  
  1191.  
  1192. Function 85h    System Request (SysReq) Key Pressed        (except PC, PCjr, XT)
  1193. entry   AH      85h
  1194.         AL      00h      key pressed
  1195.                 01h      key released
  1196. return  CF      set on error
  1197.         AH      error code
  1198. note 1) Called by BIOS keyboard decode routine when the SysReq key is detected.
  1199.      2) The BIOS handler for this call is a dummy routine that always returns a
  1200.         success status unless called with an invalid subfunction number in AL.
  1201.      3) A multitasking program manager would be expected to capture int 15h so
  1202.         that it can be notified when the user strikes the SysReq key.
  1203.  
  1204.  
  1205. Function 86h    Delay                                 (except PC, PCjr, XT)
  1206.         AH      86h
  1207.         CX:DX   4-byte integer, number of microseconds to wait
  1208.                 CX high word, DX low word
  1209. return  CF      clear   after wait elapses
  1210.         CF      set     immediately due to error
  1211. note 1) Suspends the calling program for a specified interval in microseconds.
  1212.      2) The actual duration of the wait is always an integral multiple of 976
  1213.         microseconds.
  1214.      3) Use of this function allows programmed, hardware-independent delays at
  1215.         a finer resolution than can be obtained through use of the MS-DOS Get
  1216.         Time function (int 21h fn 2Ch) which returns time in hundredths of a
  1217.         second).
  1218.      4) This function calls int 70h and is not the normal Int 08h/1Ch
  1219.         clock tick. It is generated by the MC146818A Real Time Clock chip.
  1220.         This is the battery backed up CMOS clock chip.
  1221.  
  1222.  
  1223. Function 87h    Memory Block Move                       (2-3-486 machines only)
  1224.         AH      87h
  1225.         CX      number of words to move
  1226.         ES:SI   pointer to Global Descriptor Table (GDT)
  1227.                 offset 00h-0Fh  reserved, set to zero
  1228.                            00h  null descriptor
  1229.                            08h  uninitialized, will be made into GDT descriptor
  1230.                        10h-11h  source segment length in bytes
  1231.                                 (2*CX-1 or greater)
  1232.                        12h-14h  24-bit linear source address
  1233.                        15h      access rights byte (always 93h)
  1234.                        16h-17h  reserved, set to zero
  1235.                        18h-19h  destination segment length in bytes
  1236.                                 (2*CX-1 or greater)
  1237.                        1Ah-1Ch  24-bit linear destination address
  1238.                        1Dh      access rights byte (always 93h)
  1239.                        1Eh-1Fh  reserved, set to zero
  1240.                            20h *uninitialized, used by BIOS
  1241.                            28h *uninitialized, will be made into SS descriptor
  1242.                               (*) some sources say initialized to zero
  1243. return  CF      set on error
  1244.         AH      status
  1245.                 00h     success - source copied into destination
  1246.                 01h     RAM parity error
  1247.                 02h     exception interrupt error
  1248.                 03h     address line 20 gating failed
  1249. note 1) The GDT table is composed of six 8-byte descriptors to be used by the
  1250.         CPU in protected mode. The four descriptors in offsets 00h-0Fh and
  1251.         20h-2Fh are filled in by the BIOS before the CPU mode switch.
  1252.      2) The addresses used in the descriptor table are linear (physical)
  1253.         24-bit addresses in the range 000000h-0FFFFFFh - not segments and
  1254.         offsets - with the least significant byte at the lowest address and the
  1255.         most significant byte at the highest address.
  1256.      3) Interrupts are disabled during this call; use may interfere with the
  1257.         operation of comm programs, network drivers, or other software that
  1258.         relies on prompt servicing of hardware interrupts.
  1259.      4) This call is not valid in the OS/2 Compatibility Box.
  1260.      5) This call will move a memory block from any real or protected mode
  1261.         address to any other real or protected mode address.
  1262.      6) DESQview does not intercept function 87, but QEXT and QEMM do, thereby
  1263.         allowing function 87 to work correctly inside DV.  VDISK, which uses
  1264.         function 87, works inside DV.  If VDISK is sitting at the 1 MB mark,
  1265.         then the int 19h vector will have a VDISK signature in it.  The normal
  1266.         way to check for VDISK presence is by checking for the string "VDISK"
  1267.         at offset 12h of the segment of the int 19h vector.  If the string
  1268.         matches, then you can determine how much extended memory is reserved
  1269.         for VDISK by looking at offset 2Ch is the 3-byte address of the lowest
  1270.         extended memory address NOT in use by VDISK (i.e. if you see at 2Ch
  1271.         "00 00 14" then that means that VDISK is using memory up to 1 MB +
  1272.         256K).
  1273.  
  1274.  
  1275. Function 88h    Get Extended Memory Size                   (AT, XT/286, PS/2)
  1276. entry   AH      88h
  1277. return  AX      number of contiguous 1K blocks of extended memory starting at
  1278.                 address 1024k
  1279. note 1) This call will not work in the OS/2 Compatibility Box.
  1280.      2) Some BIOSes and software manipulate the Carry Flag when this function
  1281.         is called. When tested on a vanilla 386 with AMI BIOS the machine
  1282.         returned with the carry flag set. When 386-to-the-Max was loaded, the
  1283.         flag was not set.
  1284.      3) Used by IBM VDISK 4.0.
  1285.  
  1286.  
  1287. Function 89h    Switch Processor to Protected Mode         (AT, XT/286, PS/2)
  1288. entry   AH      89h
  1289.         BH      interrupt number for IRQ0, written to ICW2 of 8259 PIC #1
  1290.                 (must be evenly divisible by 8, determines IRQ0-IRQ7)
  1291.         BL      interrupt number for IRQ8, written to ICW2 of 8259 PIC #2
  1292.                 (must be evenly divisible by 8, determines IRQ8-IRQ15)
  1293.         ES:SI   pointer to 8-entry Global Descriptor Table for protected mode:
  1294.                 offset  00h     null descriptor, initialized to zero
  1295.                         08h     GDT descriptor
  1296.                         10h     IDT (Interrupt Descriptor Table) descriptor
  1297.                         18h     DS, user's data segment
  1298.                         20h     ES, user's extra segment
  1299.                         28h     SS, user's stack segment
  1300.                         30h     CS, user's code segment
  1301.                         38h     uninitialized, used to build descriptor for
  1302.                                 BIOS code segment
  1303. return  CF      set on error
  1304.                 AH      0FFh  error enabling address line 20
  1305.         CF      clear   function successful (CPU is in protected mode)
  1306.                 AH      00h
  1307.                 CS      user-defined selector
  1308.                 DS      user-defined selector
  1309.                 ES      user-defined selector
  1310.                 SS      user-defined selector
  1311. note 1) The user must initialize the first seven descriptors; the eighth is
  1312.         filled in by the BIOS to provide addressability for its own execution.
  1313.         The calling program may modify and use the eighth descriptor for any
  1314.         purpose after return from this function call.
  1315.      2) Intercepted by Microsoft's HIMEM.SYS and Quarterdeck's QEMM.SYS.
  1316.  
  1317.  
  1318. Function 90h    Device Busy Loop                         (except PC, PCjr, XT)
  1319. entry   AH      90h
  1320.         AL      predefined device type code:
  1321.                 00h     disk                                     (may timeout)
  1322.                 01h     diskette                                 (may timeout)
  1323.                 02h     keyboard                                 (no timeout)
  1324.                 03h     PS/2 pointing device                     (may timeout)
  1325.                 80h     network
  1326.                                                                  (no timeout)
  1327.                 0FCh    hard disk reset (PS/2)                   (may timeout)
  1328.                 0FDh    diskette motor start                     (may timeout)
  1329.                 0FEh    printer                                  (may timeout)
  1330.         ES:BX   pointer to request block for type codes 80h through 0FFh
  1331.                 (for network adapters ES:BX is a pointer to network control
  1332.                 block)
  1333. return  CF      set     if wait time satisfied
  1334.                 clear   if driver must perform wait
  1335. note 1) Used by NETBIOS, TOPS Network, Tom Wagner's CTASK multitasker.
  1336.      2) Generic type codes are allocated as follows:
  1337.         00h-7Fh   non-reentrant devices; OS must arbitrate access
  1338.                   serially reusable devices
  1339.         80h-0BFh  reentrant devices; ES:BX points to a unique control block
  1340.         0C0h-0FFh wait-only calls, no complementary POST int 15/fn 91h call
  1341.      3) Invoked by the BIOS disk, printer, network, and keyboard handlers prior
  1342.         to performing a programmed wait for I/O completion.
  1343.      4) A multitasking program manager would be expected to capture int 15h/
  1344.         fn 90h so that it can dispatch other tasks while I/O is in progress.
  1345.      5) The default BIOS routine for this function simply returns with the CF
  1346.         clear and AH=00h.
  1347.  
  1348.  
  1349. Function 91h    Interrupt Completed                     (AT, XT/286, PS/2 50+)
  1350. entry   AH      91h
  1351.         AL      type code (see AH=90h above)
  1352.                 00h-7Fh  serially reusable devices
  1353.                 80h-0BFh reentrant devices
  1354.         ES:BX   pointer to request block for type codes 80h through 0BFh
  1355. return  AH       00h
  1356. note 1) Used by NETBIOS and TOPS network, Tom Wagner's CTASK multitasker.
  1357.      2) Invoked by the BIOS disk network, and keyboard handlers to signal that
  1358.         I/O is complete and/or the device is ready.
  1359.      3) Predefined device types that may use Device POST are:
  1360.         00H  disk                   (may timeout)
  1361.         01H  floppy disk            (may timeout)
  1362.         02H  keyboard               (no timeout)
  1363.         03H  PS/2 pointing device   (may timeout)
  1364.         80H  network                (no timeout)
  1365.      4) The BIOS printer routine does not invoke this function because printer
  1366.         output is not interrupt driven.
  1367.      5) A multitasking program manager would be expected to capture int 15h/
  1368.         fn 91h so that it can be notified when I/O is completed and awaken the
  1369.         requesting task.
  1370.      6) The default BIOS routine for this function simply returns with the CF
  1371.         flag clear and AH=00h.
  1372.  
  1373.  
  1374. Function 0C0h   Get System Configuration      (XT after 1/10/86, PC Convertible,
  1375.                                                XT/286, AT, PS/2)
  1376. entry   AH      0C0h
  1377. return  CF      set     if BIOS doesn't support call
  1378.         ES:BX   pointer to ROM system descriptor table
  1379.           bytes 00h-01h number of bytes in the following table (norm. 16 bytes)
  1380.                 02h     system ID byte; see Chapter 2 for interpretation
  1381.                 03h     secondary ID distingushes between AT and XT/286, etc.
  1382.                 04h     BIOS revision level, 0 for 1st release, 1 for 2nd, etc.
  1383.                 05h     feature information byte
  1384.                    bits 0       reserved
  1385.                         1       Micro Channel bus (instead of ISA or EISA)
  1386.                         2       extended BIOS area allocated at 640k
  1387.                         3       wait for external event supported (int 15fn41)
  1388.                                  used on Convertible; reserved on PS/2 systems
  1389.                         4       kbd intrcpt:int 15h, fn 04h called upon int 09h
  1390.                         5       realtime clock installed
  1391.                         6       second 8259 installed (cascaded IRQ2)
  1392.                         7       DMA channel 3 - used by hard disk BIOS
  1393.                 06h     unknown (set to 0) (reserved by IBM)
  1394.                 07h     unknown (set to 0) (reserved by IBM)
  1395.                 08h     unknown (set to 0)
  1396.                 09h     unknown (set to 0) (Award BIOS copyright here)
  1397. note 1) Int 15h is also used for the Multitask Hook on PS/2 machines. No
  1398.         register settings available yet.
  1399.      2) The 1/10/86 XT BIOS returns an incorrect value for the feature byte.
  1400.      3) Novell documents some versions of Netware prior to 2.2 as having
  1401.         problems on PS/2 machines due to a bug which did not return from the
  1402.         interrupt correctly.
  1403.      4) Some AMI BIOSes do not support this function. (early Dell machines)
  1404.  
  1405.  
  1406. Function 0C1h   Return Extended BIOS Data Area Segment Address         (PS/2)
  1407. entry   AH      0C1h
  1408. return  CF      set on error
  1409.         ES      segment of XBIOS data area
  1410. note 1) The XBIOS Data Area is allocated at the high end of conventional memory
  1411.         during the POST (Power-On-Self-Test) sequence.
  1412.      2) The word at 0040:0013h (memory size) is updated to reflect the reduced
  1413.         amount of memory available for DOS and application programs.
  1414.      3) The 1st byte in the XBIOS Data Area is initialized to its length in K.
  1415.      4) A program can determine whether the XBIOS Data Area exists by using
  1416.         int 15h/fn 0C0h.
  1417.  
  1418.  
  1419. Function 0C2h   Pointing Device BIOS Interface      (DesQview 2.x)    (PS/2)
  1420. entry   AH      0C2h
  1421.         AL      00h     Enable/Disable Pointing Device
  1422.                         BH      00h     disable
  1423.                                 01h     enable
  1424.                 01h     Reset Pointing Device
  1425.                          Resets the system's mouse or other pointing device,
  1426.                         sets the sample rate, resolution, and other
  1427.                         characteristics to their default values.
  1428.                         return  BH      device ID (0=first)
  1429.                         note 1) After a reset operation, the state of the
  1430.                                  pointing device is as follows:
  1431.                                  disabled;
  1432.                                  sample rate at 100 reports per second;
  1433.                                  resolution at 4 counts per millimeter;
  1434.                                  scaling at 1 to 1.
  1435.                              2) The data package size is unchanged by this fn.
  1436.                              3) Apps can use the fn 0C2h subfunctions to
  1437.                                 initialize the pointing device to other parms,
  1438.                                 then enable the device with fn 00h.
  1439.                              4) BL is altered on return.
  1440.                 02h     Set Sampling Rate
  1441.                         BH      00h     10/second
  1442.                                 01h     20/second
  1443.                                 02h     40/second
  1444.                                 03h     60/second
  1445.                                 04h     80/second
  1446.                                 05h     100/second  (default)
  1447.                                 06h     200/second
  1448.                 03h     Set Pointing Device Resolution
  1449.                         BH      00h     one count per mm
  1450.                                 01h     two counts per mm
  1451.                                 02h     four counts per mm  (default)
  1452.                                 03h     eight counts per mm
  1453.                 04h     Get Pointing Device Type
  1454.                         return  BH      ID code for the mouse or other pointing
  1455.                                         device
  1456.                 05h     Initialize Pointing Device Interface
  1457.                          Sets the data package size for the system's mouse or
  1458.                         other pointing device, and initializes the resolution,
  1459.                         sampling rate, and scaling to their default values.
  1460.                         BH      data package size (1 - 8 bytes)
  1461.                         note    After this operation, the state of the pointing
  1462.                                 device is as follows:
  1463.                                 a) disabled;
  1464.                                 b) sample rate at 100 reports per second;
  1465.                                 c) resolution at 4 counts per millimeter;
  1466.                                 d) scaling set at 1 to 1.
  1467.                 06h     Get Status or Set Scaling Factor
  1468.                          Returns the current status of the system's mouse or
  1469.                         other pointing device or sets the device's scaling
  1470.                         factor.
  1471.                         BH      00h     return device status
  1472.                                 return  BL      status byte
  1473.                                   bits  0       set if right button pressed
  1474.                                         1       reserved
  1475.                                         2       set if left button pressed
  1476.                                         3       reserved
  1477.                                         4       0       1:1 scaling
  1478.                                                 1       2:1 scaling
  1479.                                         5       0       device disabled
  1480.                                                 1       device enabled
  1481.                                         6       0       stream mode
  1482.                                                 1       remote mode
  1483.                                         7       reserved
  1484.                                         CL      resolution
  1485.                                                 00h     1 count per millimeter
  1486.                                                 01h     2 counts per millimeter
  1487.                                                 02h     4 counts per millimeter
  1488.                                                 03h     8 counts per millimeter
  1489.                                         DL      sample rate (hex count)
  1490.                                                 0Ah     10  reports per second
  1491.                                                 14h     20  reports per second
  1492.                                                 28h     40  reports per second
  1493.                                                 3Ch     60  reports per second
  1494.                                                 50h     80  reports per second
  1495.                                                 64h     100 reports per second
  1496.                                                 0C8h    200 reports per second
  1497.                                 01h     set scaling to 1:1
  1498.                                 02h     set scaling to 2:1
  1499.                 07h     Set Pointing Device Handler Address
  1500.                          Notifies BIOS pointing device driver of the address
  1501.                         for a routine to be called each time pointing device
  1502.                         data is available.
  1503.                         ES:BX   address of user device handler
  1504.                         return  AL      00h
  1505. return  CF      set on error
  1506.         AH      status
  1507.                 00h     successful
  1508.                 01h     invalid function
  1509.                 02h     invalid input
  1510.                 03h     interface error
  1511.                 04h     need to resend
  1512.                 05h     no device handler installed
  1513. note 1) The values in BH for those functions that take it as input are stored
  1514.         in different locations for each subfunction.
  1515.      2) The user's handler for pointing device data is entered via a far call
  1516.         with four parameters on the stack:
  1517.         SS:SP+0Ah    status
  1518.         SS:SP+08h    x coordinate
  1519.         SS:SP+06h    y coordinate
  1520.         SS:SP+04h    z coordinate (always 0)
  1521.          The handler must exit via a far return without removing the parameters
  1522.         from the stack.
  1523.      3) The status parameter word passed to the user's handler is interpreted
  1524.         as follows:
  1525.         bits    0       left button pressed
  1526.                 1       right button pressed
  1527.                 2-3     reserved
  1528.                 4       sign of x data is negative
  1529.                 5       sign of y data is negative
  1530.                 6       x data has overflowed
  1531.                 7       y data has overflowed
  1532.                 8-0Fh   reserved
  1533.  
  1534.  
  1535. Function 0C3h   Enable/Disable Watchdog Timeout                 (PS/2 50+)
  1536. entry   AH      0C3h
  1537.         AL      00h     disable watchdog
  1538.                 01h     enable watchdog
  1539.                         BX      timer counter
  1540. return  CF      set on error
  1541. note 1) The watchdog timer generates an NMI.
  1542.      2) This would be subject to protection with a real OS so temporary masters
  1543.         would not be able to seize the bus forever.
  1544.  
  1545.  
  1546. Function 0C4h   Programmable Option Select                      (PS/2 50+)
  1547. entry   AH      0C4h
  1548.         AL      00h     return base POS register address
  1549.                 01h     enable slot
  1550.                         BL      slot number
  1551.                 02h     enable adapter
  1552. return  CF      set on error
  1553.         DX      base POS register address (if function 00h)
  1554. note 1) Fn 00h returns the base Programmable Option Select register address,
  1555.         enables a slot for setup, or enables an adapter.
  1556.      2) Valid on machines with Micro Channel Architecture (MCA) bus only.
  1557.      3) After a slot is enabled with fn 01h, specific information can be
  1558.         obtained for the adapter in that slot by performing port input
  1559.         operations:
  1560.         Port    Function
  1561.         100h    MCA ID (low byte)
  1562.         101h    MCA ID (high byte)
  1563.         102h    Option Select Byte 1
  1564.             bit 0       0       if disabled
  1565.                         1       if enabled
  1566.         103h    Option Select Byte 2
  1567.         104h    Option Select Byte 3
  1568.         105h    Option Select Byte 4
  1569.                 bits 6-7 are channel check indicators
  1570.         106h    Subaddress Extension (low byte)
  1571.         107h    Subaddress Extension (high byte)
  1572.  
  1573.  
  1574. Function 0C5h   Used by PS/2 Model 50+ and Olivetti MCA machines
  1575.                 Used by Desqview 2.2
  1576.                 Used by Lotus 123 Release 2.2
  1577.                 Used by Microsoft Word 5.0
  1578. note    Functions unknown. Reported by InfoWorld Nov 13 1989's Micro Channel
  1579.         386 test as a conflict between the above software packages. InfoWorld
  1580.         said that Quarterdeck (Desqview) was working on a fix for their
  1581.         product. No other information.
  1582.  
  1583.  
  1584. Function 0DEh   DesQview Services                             (DesQview)
  1585.  
  1586.  
  1587. ┌─────────────────────────────────────────────────────────────────────────────┐
  1588. │Interrupt 16h  Keyboard I/O                                            3**9  │
  1589. └─────────────────────────────────────────────────────────────────────────────┘
  1590. (0:0058h)       Access the keyboard. Scancodes are found in Appendix 1. ASCII
  1591.                 codes are found in Appendix 2.
  1592.  
  1593.                 IBM's original keyboard layout is referred to as the 84-key
  1594.                 or "old style". It has the function keys on the left and an
  1595.                 embedded cursor/numeric keypad on the right. The 101-key "new
  1596.                 style" or "enhanced" keyboard (such as used on the PS/2s) adds
  1597.                 several keys. The early BIOS will not detect the new scancodes
  1598.                 and the new BIOS for some reason added new function calls for
  1599.                 this purpose instead of enhancing the old ones. This causes
  1600.                 some hassle when writing programs which need to support both
  1601.                 keyboards fully. Most programs limit themselves to the 84-key
  1602.                 functions in the interest of backward compatibility.
  1603.  
  1604.                 The SWITCHES CONFIG.SYS command forces DOS 4.0 to use the
  1605.                 standard int 16h requests for keyboard I/O rather than the
  1606.                 extended int 16h requests.
  1607.  
  1608.                 The DOS KEYB command does not hook into the BIOS. It is a total
  1609.                 replacement for the BIOS int9 driver. The only good thing about
  1610.                 this is that you can use 101-key keyboards on old ATs without
  1611.                 support for enhanced keyboards. KEYB is very peculiar in its
  1612.                 handling of the keyboard, causing some programs to break. It
  1613.                 also tends to disable interrupts for a long time while process-
  1614.                 ing each scan code.
  1615.  
  1616.                 There are machines such as the Toshiba 5200 which have 84-key
  1617.                 layouts but "simulate" being 101-key, at least as far as int 16
  1618.                 goes.  (always good for confusing your software...)
  1619.  
  1620.  
  1621. Function  00h   Get Keyboard Input - read the next character in keyboard buffer,
  1622.                 if no key ready, wait for one.
  1623. entry   AH      00h
  1624. return  AH      scan code
  1625.         AL      ASCII character
  1626. note 1) Removes keystroke from buffer (destructive read).
  1627.      2) Does not work with the extra keys on the 101-key "enhanced" keyboard.
  1628.  
  1629.  
  1630. Function  01h   Check Keystroke Buffer - Do Not Clear
  1631. entry   AH      01h
  1632. return  ZF      0 (clear) if character in buffer
  1633.                 1 (set)   if no character in buffer
  1634.         AH      scan code of character (if ZF=0)
  1635.         AL      ASCII character if applicable
  1636. note 1) Keystroke is not removed from buffer. The same character and scan code
  1637.         will be returned by the next call to Int 16h/fn 00h.
  1638.      2) This call flushes the 101-key codes from the buffer if they precede
  1639.         an 84-key code.
  1640.  
  1641.  
  1642. Function  02h   Shift Status - fetch bit flags indicating shift status
  1643. entry   AH      02h
  1644. return  AL      status byte (same as [0040:0017])
  1645.            bits 7       Insert on
  1646.                 6       CapsLock on
  1647.                 5       NumLock on
  1648.                 4       ScrollLock on
  1649.                 3       Alt key down
  1650.                 2       Control key down
  1651.                 1       Left shift (left caps-shift key) down
  1652.                 0       Right shift (right caps-shift key) down
  1653. note    The Keyboard Flags Byte is stored in the BIOS Data Area at 0000:0417h.
  1654.  
  1655.  
  1656. Function 03h    Keyboard - Set Repeat Rate            (PCjr, AT, XT/286, PS/2)
  1657. entry   AH      03h
  1658.         AL      00h     reset typematic defaults                     (PCjr)
  1659.                 01h     increase initial delay                       (PCjr)
  1660.                 02h     decrease repeat rate by 1/2                  (PCjr)
  1661.                 03h     increase both delays by 1/2                  (PCjr)
  1662.                 04h     turn off typematic                           (PCjr)
  1663.                 05h     set typematic rate                           (AT, PS/2)
  1664.         BH      00h-03h for delays of 250ms, 500ms, 750ms, or 1 second
  1665.                         0,0     250ms
  1666.                         0,1     500ms
  1667.                         1,0     750ms
  1668.                         1,1     1 second
  1669.         BL      00h-1Fh for typematic rates of 30cps down to 2cps
  1670.                         00000 30     01011 10.9   10101 4.5
  1671.                         00001 26.7   01100 10     10110 4.3
  1672.                         00010 24     01101 9.2    10111 4
  1673.                         00011 21.8   01110 8.6    11000 3.7
  1674.                         00100 20     01111 8      11001 3.3
  1675.                         00101 18.5   10000 7.5    11010 3
  1676.                         00110 17.1   10001 6.7    11011 2.7
  1677.                         00111 16     10010 6      11100 2.5
  1678.                         01000 15     10011 5.5    11101 2.3
  1679.                         01001 13.3   10011 5.5    11110 2.1
  1680.                         01010 12     10100 5      11111 2
  1681. return  nothing
  1682. note 1) Subfunction 05h is available on ATs with ROM BIOS dated 11/15/85 and
  1683.         later, the XT/286, and the PS/2.
  1684.      2) Subfunction 0 (Return to Default Keyboard State) restores the keyboard
  1685.         to its original state. The original state at power-on is typematic on,
  1686.         normal initial delay and normal typematic rate.
  1687.      3) Subfunction 1 (Increase Initial Delay) increases the delay between the
  1688.         first character typed and the burst of typematic characters.
  1689.      4) For Subfunctions 0 through 4, each time the typematic rate is changed,
  1690.         all previous states are removed.
  1691.      5) Some clone keyboards (Northgate Omnikey and Focus) have much higher
  1692.         repeat rates for the same bit values.
  1693.  
  1694.  
  1695. Function 04h    Keyboard Click Toggle                 (PCjr and Convertible)
  1696. entry   AH      04h
  1697.         AL      00h     for click off
  1698.                 01h     for click on
  1699. return  nothing
  1700.  
  1701.  
  1702. Function 05h    Load Keyboard Buffer            (AT or PS/2 with enhanced kbd)
  1703. entry   AH      05h
  1704.         CH      scan code
  1705.         CL      ASCII character
  1706. return  CF      set on error
  1707.         AL      00h     success
  1708.                 01h     if buffer full
  1709. note    Places a character and scan code at the end of the keyboard type-ahead
  1710.         buffer.
  1711.  
  1712.  
  1713. Function 06h    Keyboard Buffer Write                (Fansi-Console to 2.00)
  1714. entry   AH      06h
  1715.         BX      extended key value to place in typeahead buffer
  1716. return  unknown
  1717. note    This call may be dropped since it now duplicates function 05h.
  1718.  
  1719.  
  1720. Function 07h    Change Shift Key Status              (Fansi-Console to 2.00)
  1721. entry   AH      07h
  1722.         AL      shift key status value
  1723. return  unknown
  1724. note    Status byte is same as function 02h.
  1725.  
  1726.  
  1727. Function 10h    Get Enhanced Keystroke And Read      (F11, F12 Enhanced Keyb'd)
  1728.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  1729. entry   AH      10h
  1730. return  AH      scan code
  1731.         AL      ASCII character if applicable
  1732. note 1) Reads a character and scan code from the keyboard type-ahead buffer.
  1733.      2) Use this function for the enhanced keyboard instead of int 16h fn 00h.
  1734.         It allows applications to obtain the scan codes for the additional F11,
  1735.         F12, and cursor control keys.
  1736.      3) This is the enhanced version of function 00h.
  1737.  
  1738.  
  1739. Function 11h    Check Enhanced Keystroke         (F11-F12 on enhanced keyboard)
  1740.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  1741. entry   AH      11h
  1742. return  ZF      0       (clear) if key pressed
  1743.                         AH      scan code
  1744.                         AL      ASCII character if applicable
  1745.                 1       if buffer is empty
  1746. note 1) Keystroke is not removed from buffer. The same char and scan code will
  1747.         be returned by the next call to Int 16h/fn 10h.
  1748.      2) Use this function for the enhanced keyboard instead of int 16h/fn 00h.
  1749.         It allows applications to test for the additional F11, F12, and cursor
  1750.         control keys.
  1751.  
  1752.  
  1753. Function 12h    Extended Get Shift Status         (F11, F12 Enhanced keyboard)
  1754. entry   AH      12h
  1755. return  AX      status word
  1756.                 AL bit  0       right Shift key depressed
  1757.                         1       left Shift key depressed
  1758.                         2       Control key depressed
  1759.                         3       Alt key depressed
  1760.                         4       ScrollLock state active
  1761.                         5       NumLock state active
  1762.                         6       CapsLock state active
  1763.                         7       insert state is active
  1764.                 AH bit  0       left Control key pressed
  1765.                         1       left Alt key depressed
  1766.                         2       right Control key pressed
  1767.                         3       right Alt key depressed
  1768.                         4       Scroll Lock key depressed
  1769.                         5       NumLock key depressed
  1770.                         6       CapsLock key depressed
  1771.                         7       SysReq key depressed
  1772. note    Use this function for the enhanced keyboard instead of int 16h/fn 02h.
  1773.  
  1774.  
  1775. Function  70h, 71h, 72h  Internal Functions       (SEAware's FAKEY.COM)
  1776. note    FAKEY.COM is a TSR keyboard utility distributed to registered users
  1777.         of SEAware products.
  1778.  
  1779.  
  1780. Function  75h   Set Tick Count for Scanning       (pcAnywhere 2.00)
  1781. entry   AH      75h
  1782.         AL      tick count
  1783. return  none
  1784. note 1) Sets count of 55ms timer ticks between checks for new screen changes.
  1785.      2) pcAnywhere is a program that allows operation of a remote machine
  1786.         over a serial link.
  1787.  
  1788.  
  1789. Function  76h   Set Error Checking Mode           (pcAnywhere 2.00)
  1790. entry   AH      76h
  1791.         AL      error checking type
  1792.                 00h     none
  1793.                 01h     fast
  1794.                 02h     slow
  1795. return  none
  1796.  
  1797.  
  1798. Function  77h   reserved                          (pcAnywhere 2.00)
  1799. pcAnywhere API - reserved
  1800.  
  1801.  
  1802. Function  78h   Log Off                           (pcAnywhere 2.00)
  1803. entry   AL      00h     wait for another call
  1804.                 01h     exit but remain TSR
  1805.                 02h     automatic mode - watches DTR
  1806.                 0FFh    leave in current operating mode (pcAnywhere 2.1)
  1807. return  none
  1808.  
  1809.  
  1810. Function  79h   Installation Check                (pcAnywhere 2.00)
  1811. entry   AH      79h
  1812.         AL      00h     installation check
  1813. return  AX      0FFFFh  resident and active
  1814.                 0FFFEh  resident but not active
  1815.                 0FFFDh  resident TSR
  1816.                 0FFFCh  automatic mode
  1817.                 any other value - not resident
  1818.  
  1819.  
  1820. Function  7Ah   Cancel pcAnywhere Session         (pcAnywhere 2.00)
  1821. entry   AH      7Ah
  1822. return  none
  1823. note    Leaves pcAnywhere resident but unable to answer another call.
  1824.  
  1825.  
  1826. Function  7Bh   Enable/Disable Operation          (pcAnywhere 2.00)
  1827. entry   AH      7Bh
  1828.         AL      state
  1829.                 00h     disabled
  1830.                 01h     enabled
  1831. return  none
  1832. note    Remote screen is automatically refreshed when session is enabled.
  1833.  
  1834.  
  1835. Function  7Ch   Get Port Configuration            (pcAnywhere 2.00)
  1836. entry   AH      7Ch
  1837. return  AH      port number in binary (0-15)
  1838.         AL      baud rate
  1839.                 00h     50
  1840.                 01h     75
  1841.                 02h     110
  1842.                 03h     134.5
  1843.                 04h     150
  1844.                 05h     300
  1845.                 06h     600
  1846.                 07h     1200
  1847.                 08h     1800
  1848.                 09h     2000
  1849.                 0Ah     2400
  1850.                 0Bh     4800
  1851.                 0Ch     7200
  1852.                 0Dh     9600
  1853.                 0Fh     19,200
  1854.  
  1855.  
  1856. Function  7Dh   Get/Set Terminal Parameters       (pcAnywhere 2.00)
  1857. entry   AH      7Dh
  1858.         AL      00h     set parameters
  1859.                 01h     get parameters
  1860.                 02h     get configuration header and terminal parameters
  1861.         CX:DS   address of Terminal Parameter Block
  1862. return  AL      00h     nothing
  1863.                 01h     current Terminal Parameter Block in CX:DS
  1864.                 02h     configuration header and Terminal Parameter Block
  1865.                         in CX:DS
  1866. note    Terminal Parameter Block format:   (1152 bytes) (decimal)
  1867.         384 bytes  CRT Control Information
  1868.                 bytes   function
  1869.                 1-8     cursor up
  1870.                9-16     cursor down
  1871.               17-24     cursor left
  1872.               25-32     cursor right
  1873.               33-40     cursor home
  1874.               41-48     clear screen
  1875.               49-56     clear to end of line
  1876.               57-64     clear to end of page
  1877.               65-72     insert line
  1878.               73-80     delete line
  1879.               81-88     insert character
  1880.               89-96     delete character
  1881.              97-104     cursor position lead in
  1882.             105-112     between row and column
  1883.             113-120     after cursor position
  1884.             121-128     CRT initialization
  1885.         256 bytes  Character Translation Table
  1886.                 translates ASCII characters from host. Normally changes IBM
  1887.                 graphics characters to other displayable symbols
  1888.         512 bytes  keyboard sequences
  1889.             641-644     cursor up
  1890.             645-648     cursor down
  1891.             649-652     cursor left
  1892.             653-656     cursor right
  1893.             657-660     home
  1894.             661-664     end
  1895.             665-668     PgUp
  1896.             669-672     PgDn
  1897.             673-676     insert
  1898.             677-680     delete
  1899.             681-684     control-home
  1900.             685-688     control-end
  1901.             689-692     control-PgUp
  1902.             693-696     control-PgDn
  1903.             697-700     escape
  1904.             701-740     F1...F10
  1905.             741-780     sF1...sF10
  1906.             781-820     ^F1...^F10
  1907.             821-860     aF1...aF10
  1908.             861-964     alt A-Z
  1909.            965-1004     alt 0-9
  1910.           1005-1008     alt =
  1911.           1009-1012     alt -
  1912.           1013-1016     print screen
  1913.           1017-1020     ctrl-left arrow
  1914.           1021-1024     ctrl-right arrow
  1915.           1025-1120     reserved
  1916.           1121-1124     begin conv. mode
  1917.           1125-1128     remote printing off
  1918.           1129-1132     remote printing on
  1919.           1133-1136     backspace
  1920.           1137-1140     refresh screen
  1921.           1141-1144     send next code
  1922.           1145-1148     display top 24 lines
  1923.           1149-1152     display bottom 24 lines
  1924.  
  1925.  
  1926. Function  7Eh   Serial I/O Through pcAnywhere Port   (pcAnywhere 2.00)
  1927. entry   AH      7Eh
  1928.         AL      I/O function
  1929.                 01h     get port input status
  1930.                 02h     get port input character
  1931.                 03h     output character
  1932.                 04h     hang up phone
  1933.         CX      ASCII character to output (fn 03h)
  1934. return  (if AL=01h)
  1935.         AX      00h     no character ready
  1936.                 01h     character is available
  1937.         (if AL=02h)
  1938.         AL      ASCII code received
  1939.  
  1940.  
  1941. Function  7Fh   Set Keyboard/Screen Mode            (pcAnywhere 2.00)
  1942. entry   AH      7Fh
  1943.         AL      parameters
  1944.                 00h     enable remote keyboard only  |
  1945.                 01h     enable host keyboard only    |  keyboard group
  1946.                 02h     enable both keyboards        |
  1947.  
  1948.                 08h     display top 24 lines         |  screen group
  1949.                 09h     display bottom 24 lines      |
  1950.  
  1951.                 10h     Hayes modem                  |
  1952.                 11h     other modems                 |  modem group
  1953.                 12h     direct connect               |
  1954.  
  1955.  
  1956. Function 0EDh   Borland Turbo Lightning API  (partial)
  1957. entry   AH      0EDh
  1958.         BH      0EDh
  1959.         BL      function
  1960.                 00h     installation check
  1961.                 02h     pointer to Lightning internal data structure lobyte
  1962.                 03h     pointer to Lightning internal data structure hibyte
  1963.                 04h     load auxiliary dictionary
  1964.                 06h     autoproof mode
  1965.                 0Fh     get number of substitutions (segment)
  1966.         DS:DI   pointer to string to be processed
  1967. return  AX      error code (unknown)
  1968. note    I've made several attempts to get a copy of the Turbo Lightning API,
  1969.         which was originally supposed to be available for developers in 1985.
  1970.         In 1988 Borland sent me a letter saying they were still working on it.
  1971.         In late 1989 the Borland rep on BIX told me basically that there were
  1972.         no plans for releasing the API any more. The information here was
  1973.         dredged from Chris Dunford's LSPELL.PAS interface into Lighting.
  1974.  
  1975.  
  1976. Function 0F0h   Set CPU speed                                     (Compaq 386)
  1977. entry   AH      0F0h    set speed
  1978.         AL      speed
  1979.                 00h     equivalent to 6 mHz 80286 (COMMON)
  1980.                 01h     equivalent to 8 mHz 80286 (FAST)
  1981.                 02h     full 16 mHz (HIGH)
  1982.                 03h     toggles between 8 mHz-equivalent and speed set by
  1983.                         system board switch (AUTO or HIGH)
  1984.                 04h-07h unknown
  1985.                 08h     full 16 mHz except 8 mHz-equivalent during floppy disk
  1986.                         access
  1987.                 09h     specify speed directly
  1988.                         CX      speed value, 1 (slowest) to 50 (full), 3 ~=8088
  1989. return  none?
  1990. note 1) Used by Compaq DOS MODE command.
  1991.  
  1992.  
  1993. Function 0F1h   Read Current CPU Speed                            (Compaq 386)
  1994. entry   AH      0F1h
  1995. return  AL      speed code (see function 0F0h above)
  1996.                 if AL=09h, CX=speed code
  1997.  
  1998.  
  1999. Function 0F2h   Determine Attached Keyboard Type                  (Compaq 386)
  2000. entry   AH      0F2h
  2001. return  AL      type
  2002.                 00h     if 11-bit AT keyboard is in use
  2003.                 01h     if 9-bit PC keyboard is in use
  2004.  
  2005.  
  2006. Function 0FFh   PC-Tools API
  2007. entry   AH      0FFh
  2008. other parameters unknown
  2009. note    PC-Tools is a Swiss-army-knife software package with an editor, DOS
  2010.         shell, cache, disk optimizer, and several other functions from Central
  2011.         Point Software.
  2012.  
  2013.  
  2014. Function 0FFh   2-The-Max VGA-16 Board
  2015. entry   AH      0FFh    query zoom interrupt
  2016. return  AL      zoom interrupt number
  2017.         AL+1    old BIOS keyboard handler interrupt number
  2018.         BX      hot key
  2019.  
  2020.  
  2021.  
  2022. Function 0FFh   Programmer Interface to Carbon Copy Plus (5.0)
  2023. entry   AH      0FFh
  2024.         AL      00h     check connection between CC and CCHELP
  2025. return  BL      00h     Carbon Copy not connected to CCHELP
  2026.                 01h     Carbon Copy is connected to CCHELP
  2027.  
  2028. entry   AL      01h     disconnects and resets the line if the Host or CC
  2029.                         side is connected to CCHELP
  2030.  
  2031. entry   AL      02h     return a pointer to the last phone number dialed by CC
  2032. return  ES:DI           dword pointer to ASCIIZ phone number string
  2033.  
  2034.  
  2035.  
  2036. ┌─────────────────────────────────────────────────────────────────────────────┐
  2037. │Interrupt 17h  Printer                                                 3**10 │
  2038. └─────────────────────────────────────────────────────────────────────────────┘
  2039. (0:005Ch)       access the parallel printer(s)
  2040.                 AH is changed. All other registers left alone.
  2041.  
  2042.                 Printer ports vary widely in compatibility, since the original
  2043.                 IBM MDA's parallel port did not match its own spec.  Many
  2044.                 parallel ports do not use IRQ7 at all.
  2045.  
  2046.                 The parallel port on a monochrome adapter is at 3BCh.  The port
  2047.                 on a parallel printer adapter is at 378h or 278h.  At boot time,
  2048.                 the BIOS looks at them in the order 3BCh, 378h, 278h, and
  2049.                 assigns the first port it finds to LPT1, the second to LPT2,
  2050.                 etc.  If you have a monochrome adapter, LPT1 is probably 3BCh;
  2051.                 otherwise, it is probably 378h.
  2052.  
  2053.  
  2054. Function  00h   Print Character/send AL to printer DX (0, 1, or 2)
  2055. entry   AH      00h
  2056.         AL      ASCII character code
  2057.         DX      printer to be used
  2058.                 00h     PRN or LPT1
  2059.                 01h     LPT2
  2060.                 02h     LPT3
  2061. return  AH      status byte
  2062.            bits 0       time out
  2063.                 1       unused
  2064.                 2       unused
  2065.                 3       I/O error
  2066.                 4       printer selected
  2067.                 5       out of paper
  2068.                 6       acknowledge
  2069.                 7       not busy
  2070.  
  2071.  
  2072. Function 01h    Initialize Printer - set init line low, send 0Ch to printer DX
  2073. entry   AH      01h
  2074.         DX      printer port to be initialized (0,1,2)
  2075. return  status as below
  2076.  
  2077.  
  2078. Function  02h   Printer Status - read status of printer DX into AH
  2079. entry   AH      02h
  2080.         DX      printer port to be used (0,1,2)
  2081. return  AH      status byte
  2082.            bits 7       0       busy/paused: the printer cannot immediately
  2083.                                 take more data because it is in the middle of
  2084.                                 accepting a character, printing a line, is
  2085.                                 offline, or it is in error status.
  2086.                         1       ready
  2087.                 6   ACKnowledge line toggled: reflects the state of the ACK
  2088.                     line on the printer port at the moment the status was read.
  2089.                     ACK is a strobe: it goes low for a very short time (12
  2090.                     microseconds on an Epson) when the printer is ready for
  2091.                     another character. As far as printer status is concerned,
  2092.                     this is useless; it's only useful for something like an
  2093.                     interrupt-driven interface. Most of the time, you'll see
  2094.                     ACK high (bit 6 on), but occasionally, if you check status
  2095.                     just after sending a character, you might see it low.
  2096.                     ACK is low when the printer is powered off.
  2097.                 5   out-of-paper line toggled
  2098.                 4   printer selected: printer is selected/ready/online. There
  2099.                     is usually a button on the printer to control this.
  2100.                 3   I/O error: offline, out of paper or other error condition
  2101.                     such as out of ribbon.
  2102.                 2   unused
  2103.                 1   unused
  2104.                 0   timeout error: printer failed to send ACK and drop busy
  2105.                     after being sent a character.
  2106. note 1) You can expect to see these states in a properly functioning printer:
  2107.         Normal                Offline                Power off
  2108.         ======                =======                =========
  2109.         not busy/paused       busy/paused            busy/paused
  2110.         not out of paper      not out of paper       not out of paper
  2111.         selected/online       not selected/online    not selected/online
  2112.         not I/O error         I/O error (usually)    I/O error
  2113.         not timeout error     not timeout error      not timeout error
  2114.      2) Not all printers return the status codes properly. That's OK, not all
  2115.         clone BIOS do it right either. If your program depends on the return
  2116.         codes, you might want to make the code easily patched or configured
  2117.         for nonstandard hardware.
  2118.  
  2119.  
  2120. Function   03h  Versa-Spool print spooler
  2121. entry   AH      03h     Versa-Spool
  2122.         AL      00h     Return Signature
  2123.                 01h     Toggle Pause
  2124.                 02h     Clear Buffer
  2125.                 03h     Request Pause Condition
  2126.                 04h     Request Free Buffer Space
  2127.                 05h     Request Total Buffer Size
  2128.                 06h     Redirect Output to LPT1
  2129.                 07h     Redirect Output to LPT2
  2130.                 08h     Redirect Output to LPT3
  2131.                 09h     Request Output Device
  2132.                 0Ah     Request Output Speed
  2133.                 0Bh     Request Device Spooled Status
  2134.  
  2135. return  (AH=00h)        AX      1234h   if Versa-Spool is installed
  2136.                                         undefined if not installed
  2137.         (AH=01h)        AX      0001h   if paused
  2138.                                 0000h   if resumed
  2139.         (AH=02h)        AX      0302h   not cleared
  2140.                                 0000h   cleared
  2141.         (AH=03h)        AX      0001h   if paused
  2142.                                 0000h   if resumed
  2143.         (AH=04h)        AX      remaining buffer space (in Kbytes)
  2144.         (AH=05h)        AX      total buffer space (in Kbytes)
  2145.         (AH=06h)        AX      nothing
  2146.         (AH=07h)        AX      nothing
  2147.         (AH=08h)        AX      nothing
  2148.         (AH=09h)        AX      printer output (0..2)
  2149.         (AH=0Ah)        AX      output speed in CPS
  2150.         (AH=0Bh)        AX      0001h   is spooled
  2151.                                 0000h   otherwise
  2152.  
  2153. Function  0C0h  PC Magazine PCSPOOL - get printer status
  2154. entry   AH      0C0h
  2155.         DX      printer port to be used (0,1,2)
  2156. return  ES:BX   address of printer control block
  2157. note    PC Magazine, January 15, 1991. (Vol 10, Number 1)
  2158.  
  2159.  
  2160. Function  0C1h  PC Magazine PCSPOOL - add pause to spool queue
  2161. entry   AH      0C1h
  2162.         DX      printer port to be used (0,1,2)
  2163.         DS:SI   pointer to ASCIIZ string to display
  2164. return  AH      printer status
  2165.  
  2166.  
  2167. Function  0C2h  PC Magazine PCSPOOL - flush queue record
  2168. entry   AH      0C2h
  2169.         DX      printer port to be used (0,1,2)
  2170. return  AH      printer status
  2171.  
  2172.  
  2173. Function  0C3h  PC Magazine PCSPOOL - cancel printer queue
  2174. entry   AH      0C3h
  2175.         DX      printer port to be used (0,1,2)
  2176. return  AH      printer status
  2177.  
  2178.  
  2179. Function  0C4h  PC Magazine PCSPOOL - determine of spooler is active
  2180. entry   AH      0C4h
  2181. return  DI      0B0BFh  if PCSPOOL is loaded
  2182.         SI      segment of the PSP of the active PCSPOOL
  2183.  
  2184.  
  2185. ┌─────────────────────────────────────────────────────────────────────────────┐
  2186. │Interrupt 18h  ROM BASIC                                               3**11 │
  2187. └─────────────────────────────────────────────────────────────────────────────┘
  2188. (0:0060h)       Execute ROM BASIC at address 0F600h:0000h
  2189. entry   no parameters used
  2190. return  jumps into ROM BASIC on IBM systems
  2191. note 1) Often reboots a compatible.
  2192.      2) Used by Turbo C 1.5. 2.0 and later do not use it.
  2193.      3) On IBM systems, this interrupt is called if disk boot failure occurs.
  2194.      4) Video interrupt on DEC Rainbow.
  2195.      5) Digital Research's ROM-based implementation of DR-DOS uses int 18h as
  2196.         the initial entry vector into the operating system code. Note that
  2197.         some clone BIOSes may not properly implement int 18h in the ROM and
  2198.         use of DR-DOS ROMs may not always work.
  2199.      6) Maxon 286/HD laptop: called by BIOS power management routines to
  2200.         communicate with applications.
  2201.  
  2202.  
  2203.  
  2204. ┌─────────────────────────────────────────────────────────────────────────────┐
  2205. │Interrupt 19h  Bootstrap Loader / Extended Memory VDISK ID             3**12 │
  2206. └─────────────────────────────────────────────────────────────────────────────┘
  2207. (0:0064h)
  2208. entry   no parameters used
  2209. return  none
  2210. note 1) Reads track 0, sector 1 into address 0000h:7C00h, then transfers
  2211.         control to that address. If no diskette drive available, looks at
  2212.         absolute address C:800 for a valid hard disk or other ROM. If none,
  2213.         transfers to ROM-BASIC via int 18h or displays loader error message.
  2214.      2) Causes reboot of disk system if invoked while running. (no memory test
  2215.         performed).
  2216.      3) If location 0000:0472h does not contain the value 1234h, a memory test
  2217.         (POST) will be performed before reading the boot sector.
  2218.      4) VDISK from DOS 3.0+ traps this vector to determine when the CPU has
  2219.         shifted from protected mode to real mode. A detailed discussion can
  2220.         be found by Ray Duncan in PC Magazine, May 30, 1989.
  2221.      5) Reportedly, some versions of DOS 2.x and all versions of DOS 3.x+
  2222.         intercept int 19h in order to restore some interrupt vectors DOS takes
  2223.         over, in order to put the machine back to a cleaner state for the
  2224.         reboot, since the POST will not be run on the int 19h. These vectors
  2225.         are reported to be: 02h, 08h, 09h, 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 70h, 72h,
  2226.         73h, 74h, 75h, 76h, and 77h. After restoring these, it restores the
  2227.         original int 19h vector and calls int 19h.
  2228.      6) The system checks for installed ROMs by searching memory from 0C000h to
  2229.         the beginning of the BIOS, in 2k chunks. ROM memory is identified if it
  2230.         starts with the word 0AA55h. It is followed a one byte field length of
  2231.         the ROM (divided by 512). If ROM is found, the BIOS will call the ROM
  2232.         at an offset of 3 from the beginning. This feature was not supported in
  2233.         the earliest PC machines. The last task turns control over to the
  2234.         bootstrap loader (assuming the floppy controller is operational).
  2235.      7) 8255 port 60h bit 0 = 1 if booting from diskette.
  2236.  
  2237.  
  2238.  
  2239. ┌─────────────────────────────────────────────────────────────────────────────┐
  2240. │Interrupt 1Ah  Time of Day                                             3**13 │
  2241. └─────────────────────────────────────────────────────────────────────────────┘
  2242.  
  2243. (0:0068h)    1) Accesses the PC internal clock.
  2244.              2) This interrupt is not supported on some machines, such as
  2245.                 the HP150 PC.
  2246.              3) Some "turbo" BIOSes run the clock slower than normal in order
  2247.                 to throw off benchmark software, which usually uses int 1Ah
  2248.                 for timekeeping.
  2249.              4) Counts occur at the rate of 1193180/65536 counts/sec (about
  2250.                 18.2 per second).
  2251.  
  2252. Function 00h    Read System Timer Tick Counter                 (except PC)
  2253. entry   AH      00h
  2254. return  AL      00h     if clock was read or written (via AH=0,1) within the
  2255.                         current 24-hour period.
  2256.                 <>0     midnight was passed since last read
  2257.         CX:DX   32-bit tick count (high 16 bits in CX)
  2258. note 1) The returned value is the cumulative number of clock ticks since
  2259.         midnight. There are 18.2 clock ticks per second, or one every 54.92ms.
  2260.         When the counter reaches 1,573,040, it is cleared to zero, and the
  2261.         rollover flag is set.
  2262.      2) The rollover flag is cleared by this function call, so the flag will
  2263.         only be returned nonzero once per day.
  2264.      3) Int 1Ah/fn 01h can be used to set the counter to an arbitrary 32 bit
  2265.         value.
  2266.      4) This function does not return seconds/100 in DL. The best you can do
  2267.         is set it to zero (or any value <=99). This means that your DOS clock
  2268.         could be up to 1 second off from the BIOS clock, however the effect is
  2269.         not cumulative.
  2270.  
  2271.  
  2272. Function 01h    Set Clock Tick Counter Value                    (except PC)
  2273. entry   AH      01h
  2274.         CX:DX   32-bit high word/low word count of timer ticks
  2275. return  none
  2276. note 1) The clock ticks are incremented by timer interrupt at 18.2065 times
  2277.         per second or 54.9254 milliseconds/count. Therefore:
  2278.                 counts per second   18      (12h)
  2279.                 counts per minute   1092    (444h)
  2280.                 counts per hour     65543   (10011h)
  2281.                 counts per day      1573040 (1800B0h)
  2282.      2) The counter is zeroed when system is rebooted.
  2283.      3) Stores a 32-bit value in the clock tick counter.
  2284.      4) The rollover flag is cleared by this call.
  2285.  
  2286.  
  2287. Function 02h    Read Real Time Clock Time                       (AT and after)
  2288. entry   AH      02h
  2289. return  CH      hours in BCD
  2290.         CL      minutes in BCD
  2291.         DH      seconds in BCD
  2292.         DL      00h     standard time
  2293.                 01h     daylight savings time
  2294.         CF      0       if clock running
  2295.                 1       if clock not operating
  2296. note 1) Reads the current time from the CMOS time/date chip.
  2297.      2) Also for Leading Edge Model M.
  2298.      3) According to Phoenix this call will fail if the BIOS is "updating" its
  2299.         clock value. You should check the carry flag and retry if it is set
  2300.         following the call.
  2301.  
  2302.  
  2303. Function 03h    Set Real Time Clock Time                        (AT and after)
  2304. entry   AH      03h
  2305.         CH      hours in BCD
  2306.         CL      minutes in BCD
  2307.         DH      seconds in BCD
  2308.         DL      0 (clear) if standard time
  2309.                 1 (set)   if daylight savings time option
  2310. return  none
  2311. note 1) Sets the time in the CMOS time/date chip.
  2312.      2) Also for Leading Edge Model M.
  2313.  
  2314.  
  2315. Function 04h    Read Real Time Clock Date                       (AT and after)
  2316. entry   AH      04h
  2317. return  CH      century in BCD (19 or 20)
  2318.         CL      year in BCD
  2319.         DH      month in BCD
  2320.         DL      day in BCD
  2321.         CF      0 (clear) if clock is running
  2322.                 1 (set)   if clock is not operating
  2323. note 1) Reads the current date from the CMOS time/date chip.
  2324.      2) Also for Leading Edge Model M.
  2325.  
  2326.  
  2327. Function 05h    Set Real Time Clock Date                        (AT and after)
  2328. entry   AH      05h
  2329.         CH      century in BCD (19 or 20)
  2330.         CL      year in BCD
  2331.         DH      month in BCD
  2332.         DL      day in BCD
  2333. return  none
  2334. note 1) Sets the date in the CMOS time/date chip.
  2335.      2) Also for Leading Edge Model M.
  2336.  
  2337.  
  2338. Function 06h    Set Real Time Clock Alarm                       (AT and after)
  2339. entry   AH      06h
  2340.         CH      hours in BCD
  2341.         CL      minutes in BCD
  2342.         DH      seconds in BCD
  2343. return  CF      set if alarm already set or clock inoperable
  2344. note 1) Sets alarm in the CMOS date/time chip. Int 4Ah occurs at specified
  2345.         alarm time every 24hrs until reset with Int 1Ah/fn 07h.
  2346.      2) A side effect of this function is that the clock chip's interrupt
  2347.         level (IRQ8) is enabled.
  2348.      3) Only one alarm may be active at any given time.
  2349.      4) The program using this function must place the address of its interrupt
  2350.         handler for the alarm in the vector for Int 4Ah.
  2351.  
  2352.  
  2353. Function 07h    Reset Real Time Clock Alarm                     (AT and after)
  2354. entry   AH      07h
  2355. return  none
  2356. note 1) Cancels any pending alarm request on the CMOS date/time chip.
  2357.      2) This function does not disable the clock chip's interrupt level (IRQ8).
  2358.  
  2359.  
  2360. Function 08h    Set Real Time Clock Activated Power On Mode     (Convertible)
  2361. entry   AH      08h
  2362.         CH      hours in BCD
  2363.         CL      minutes in BCD
  2364.         DH      seconds in BCD
  2365.  
  2366.  
  2367. Function 09h    Read Real Time Clock Alarm Time and Status
  2368.                                                 (Convertible and PS/2 Model 30)
  2369. entry   AH      09h
  2370. return  CH      hours in BCD
  2371.         CL      minutes in BCD
  2372.         DH      seconds in BCD
  2373.         DL      alarm status:
  2374.                 00h     if alarm not enabled
  2375.                 01h     if alarm enabled but will not power up system
  2376.                 02h     if alarm will power up system
  2377.  
  2378.  
  2379. Function 0Ah    Read System-Timer Day Counter                          (PS/2)
  2380. entry   AH      0Ah
  2381. return  CF      set on error
  2382.         CX      count of days since Jan 1,1980
  2383. note    Returns the contents of the system's day counter.
  2384.  
  2385.  
  2386. Function 0Bh    Set System-Timer Day Counter                           (PS/2)
  2387. entry   AH      0Bh
  2388.         CX      count of days since Jan 1,1980
  2389. return  CF      set on error
  2390. note    Stores an arbitrary value in the system's day counter.
  2391.  
  2392.  
  2393. Function 80h    Set Up Sound Multiplexor                (PCjr) (Tandy 1000?)
  2394. entry   AH      80h
  2395.         AL      sound source
  2396.                 00h     source is 8253 timer chip, channel 2
  2397.                 01h     source is cassette input
  2398.                 02h     source is I/O channel "audio in" line
  2399.                 03h     source is TI sound generator chip
  2400. return  none
  2401. note    Sets up the source for tones that will appear on the PCjr's Audio Out
  2402.         bus line or RF modulator.
  2403.  
  2404.  
  2405. Function 1Ah    Read Time and Date                                 (AT&T 6300)
  2406. entry   AH      0FEh
  2407. return  BX      days count (1=Jan 1, 1984)
  2408.         CH      hours
  2409.         CL      minutes
  2410.         DH      seconds
  2411.         DL      hundredths
  2412. note    Day count in BX is unique to AT&T/Olivetti computers.
  2413.  
  2414.  
  2415.  
  2416. ┌─────────────────────────────────────────────────────────────────────────────┐
  2417. │Interrupt 1Bh  Control-Break                                           3**14 │
  2418. └─────────────────────────────────────────────────────────────────────────────┘
  2419. (0:006Ch)       This interrupt is called when the keyboard handler of the IBM
  2420.                 machines detects Ctrl and Break pressed at the same time. DOS
  2421.                 normally point this interrupt at its own Ctrl-Break handler.
  2422.  
  2423. note 1) If the break occurred while processing an interrupt, one or more
  2424.         end of interrupt commands must be send to the 8259 Programmable
  2425.         Interrupt Controller.
  2426.      2) All I/O devices should be reset in case an operation was underway at
  2427.         the time.
  2428.      3) It is normally pointed to an IRET during system initialization so that
  2429.         it does nothing, but some programs change it to return a Ctrl-C scan
  2430.         code and thus invoke int 23h.
  2431.  
  2432.  
  2433.  
  2434. ┌─────────────────────────────────────────────────────────────────────────────┐
  2435. │Interrupt 1Ch  Timer Tick                                              3**15 │
  2436. └─────────────────────────────────────────────────────────────────────────────┘
  2437. (0:0070h)
  2438. note 1) Taken 18.2065 times per second by the int 08h interrupt.
  2439.      2) Normally vectors to dummy IRET unless PRINT.COM has been installed.
  2440.      3) If an application moves the interrupt pointer, it is the responsibility
  2441.         of that application to save and restore all registers that may be
  2442.         modified.
  2443.      4) returns values at absolute address 40:6x (BIOS Data Area); number of
  2444.         ticks since midnight
  2445.         40:6C   word    timer counter high word
  2446.         40:6E   word    timer counter low word
  2447.      5) Ventura Publisher 2.0 grabs this interrupt and does not pass subsequent
  2448.         vector reassignments along. This causes problems with some TSRs and
  2449.         network software.
  2450.      6) When installing a user interrupt for int 1Ch, the external interrupts
  2451.         must be disabled before the vector is altered. If a timer interrupt
  2452.         occurs between the setting of the offset and segment, an incorrect
  2453.         address will result.
  2454.  
  2455.  
  2456. ┌─────────────────────────────────────────────────────────────────────────────┐
  2457. │Interrupt 1Dh  Vector of Video Initialization Parameters               3**16 │
  2458. └─────────────────────────────────────────────────────────────────────────────┘
  2459. (0:0074h)       This doubleword address points to 3 sets of 16-bytes containing
  2460.                 data to initialize for video modes for video modes 0 & 1 (40
  2461.                 column), 2 & 3 (80 column), and 4, 5 & 6 (graphics) on the
  2462.                 Motorola 6845 CRT controller chip.
  2463.  6845 registers:
  2464.         R0      horizontal total                (horizontal sync in characters)
  2465.         R1      horizontal displayed                      (characters per line)
  2466.         R2      horizontal sync position           (move display left or right)
  2467.         R3      sync width         (vertical and horizontal pulse: 4-bits each)
  2468.         R4      vertical total                          (total character lines)
  2469.         R5      vertical adjust                (adjust for 50 or 60 Hz refresh)
  2470.         R6      vertical displayed                   (lines of chars displayed)
  2471.         R7      vertical sync position               (lines shifted up or down)
  2472.         R8      interlace (bits 4 and 5) and skew (bits 6 and 7)
  2473.         R9      max scan line addr               (scan lines per character row)
  2474.         R10     cursor start                     (starting scan line of cursor)
  2475.         R11     cursor stop                        (ending scan line of cursor)
  2476.         R12     video memory start address high byte                   (6 bits)
  2477.         R13     video memory start address low byte                    (8 bits)
  2478.         R14     cursor address high byte                               (6 bits)
  2479.         R15     cursor address low byte                                (8 bits)
  2480.  
  2481.  6845 Video Init Tables:
  2482.         table for modes 0 and 1   \
  2483.         table for modes 2 and 3    \ each table is 16 bytes long and
  2484.         table for modes 4,5, and 6 / contains values for 6845 registers
  2485.         table for mode 7          /
  2486.       4 words   size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  2487.       8 bytes   number of columns in each mode
  2488.       8 bytes   video controller mode byte for each mode
  2489. note 1) There are 4 separate tables, and all 4 must be initialized if all
  2490.         video modes will be used.
  2491.      2) The power-on initialization code of the computer points this vector
  2492.         to the ROM BIOS video routines.
  2493.      3) IBM recommends that if this table needs to be modified, it should be
  2494.         copied into RAM and only the necessary changes made.
  2495.  
  2496.  
  2497.  
  2498.  
  2499. ┌─────────────────────────────────────────────────────────────────────────────┐
  2500. │Interrupt 1Eh  Vector of Diskette Controller Parameters                3**17 │
  2501. └─────────────────────────────────────────────────────────────────────────────┘
  2502. (0:0078h)       Dword address points to data base table that is used by BIOS.
  2503.                 Default location is at 0F000:0EFC7h. 11-byte table format:
  2504.           bytes:
  2505.                 00h     4-bit step rate, 4-bit head unload time
  2506.                 01h     7-bit head load time, 1-bit DMA flag
  2507.                 02h     54.9254 ms ticks - delay til motor off (36-38 typical)
  2508.                 03h     sector size:
  2509.                         00h     128 bytes
  2510.                         01h     256 bytes
  2511.                         02h     512 bytes
  2512.                         03h     1024 bytes
  2513.                 04h     last sector on track                  (8 or 9 typical)
  2514.                 05h     inter-sector gap on read/write            (42 typical)
  2515.                 06h     data length for DMA transfers           (0FFh typical)
  2516.                 07h     gap length between sectors for format     (80 typical)
  2517.                 08h     sector fill byte for format             (0F6h typical)
  2518.                 09h     head settle time (in milliseconds)  (15 to 25 typical)
  2519.                         DOS 1.0   0
  2520.                         DOS 1.10  0
  2521.                         DOS 2.10  15
  2522.                         DOS 3.1   1
  2523.                 0Ah     motor start time (in 1/8 sec intervals)  (2-4 typical)
  2524.                         DOS 2.10  2
  2525. note 1) This vector is pointed to the ROM BIOS diskette tables on system
  2526.         initialization
  2527.      2) IBM recommends that if this table needs to be modified, it should be
  2528.         copied into RAM and only the necessary changes made.
  2529.      3) Some versions of DOS 3.2 may contain a bug. DOS 3.2 assumes that the
  2530.         dword at 0070:0F37 contains the address of the diskette parameter
  2531.         block and changes values in that block. The location does contain a
  2532.         copy of the value at 0:78 (int 1Eh, DISK_POINTER) if DOS is booted from
  2533.         diskette, but when booted from the hard disk, the location contains
  2534.         0:0. This leads to strange things, especially when running under a
  2535.         debugger since DOS overwrites parts of the interrupt vectors for
  2536.         interrupts 1 to 3. The solution to the problem is to either upgrade
  2537.         to DOS 3.3 or to copy the disk parameter vector to 70:0F37 before
  2538.         running or at the start of your program.
  2539.  
  2540.  
  2541.  
  2542. ┌─────────────────────────────────────────────────────────────────────────────┐
  2543. │Interrupt 1Fh  Ptr to Graphics Character Extensions (Graphics Set 2)   3**18 │
  2544. └─────────────────────────────────────────────────────────────────────────────┘
  2545. (0:007Ch)       This is the pointer to data used by the ROM video routines to
  2546.                 display characters above ASCII 127 while in CGA medium and high
  2547.                 res graphics modes.
  2548.  
  2549. note 1) Doubleword address points to 1K table composed of 28 8-byte character
  2550.         definition bit-patterns. First byte of each entry is top row, last byte
  2551.         is bottom row.
  2552.      2) The first 128 character patterns are located in system ROM.
  2553.      3) This vector is set to 000:0 at system initialization.
  2554.      4) Used by DOS' external GRAFTABL command.
  2555.  
  2556.